Generic relations missing with grappelli

Posted by diegueus9 on Stack Overflow See other posts from Stack Overflow or by diegueus9
Published on 2010-02-01T16:59:11Z Indexed on 2010/04/10 17:33 UTC
Read the original article Hit count: 455

I'm using the last svn revision of grappelli and rev 11840 of django (before multidatabases and stuff), and i'm trying to use generic relations in the admin, but doesn't work,

The model:

class AutorProyectoLey(DatedModel):
    tipo_autor = models.ForeignKey(ContentType)
    autor_id = models.PositiveIntegerField()
    content_object = generic.GenericForeignKey('tipo_autor', 'autor_id')
    proyecto_ley = models.ForeignKey(ProyectoLey)

The admin:

class AutorInline(GenericInlineModelAdmin):
    model = AutorProyectoLey
    allow_add = True
    ct_field = 'tipo_autor'
    ct_fk_field = 'autor_id'
    classes = ('collapse-open',)

And i put this model of var inlines in another adminmodel, but the html render is :

       <!-- Inlines -->






       <!-- Submit-Row -->

© Stack Overflow or respective owner

Related posts about django-admin

Related posts about django-grappelli