开发者

Generic relations missing with grappelli

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 -->


Is necesary for grappelli the fields names content_type and object_id in other way doesn't work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜