0

grappelliの最後のsvnリビジョンとdjangoのrev11840(マルチデータベースなどの前)を使用していますが、管理者で汎用リレーションを使用しようとしていますが、機能しません、

モデル:

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)

管理者:

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

そして、このvarインラインのモデルを別のadminmodelに入れましたが、htmlレンダリングは次のとおりです。

       <!-- Inlines -->






       <!-- Submit-Row -->
4

1 に答える 1

0

grappelli のフィールド名 content_type および object_id が他の方法で機能しない場合に必要です。

于 2010-04-10T17:29:56.300 に答える