second level nested inlines not showing in django-nested-inlines

248 views
Skip to first unread message

Andreas Bloch

unread,
Apr 16, 2014, 1:59:10 AM4/16/14
to django...@googlegroups.com

I'm trying to add a nested admin interface using https://github.com/s-block/django-nested-inline but the 2nd level is not showing up in the admin...

I have a foreign key relationship between three models:

ContractTemplate => ContractClause => ContractSubClauses

(i.e. a template can have many clauses and every clause can have many sub-clauses)

models.py

class ContractTemplate(models.Model):
    name = models.CharField()
    ...

class ContractClause(models.Model):
    contract_template = models.ForeignKey(ContractTemplate)
    title = models.CharField()
    ...

class ContractSubClauses(models.Model):
    contract_clause = models.ForeignKey(ContractClause)
    text = models.TextField()
    ...

admin.py

from nested_inlines.admin import NestedModelAdmin, NestedStackedInline, NestedTabularInline


class ContractSubClauseInline(NestedTabularInline):
    model = ContractSubClause

class ContractClauseInline(NestedStackedInline):
    model = ContractClause
    inlines = [ContractSubClauseInline]

class ContractTemplateAdmin(NestedModelAdmin):
    inlines = [ContractClauseInline]

admin.site.register(ContractTemplate, ContractTemplateAdmin)


This is how the admin looks (first level - ContractClause - shows, but ContractSubClause(s) are not showing):

What is missing to show the ContractSubClause(s)?

Hangloser Firestarter

unread,
Jun 16, 2014, 11:17:25 AM6/16/14
to django...@googlegroups.com
Someone managed to solve this problem?

I have this problem, too. The level 1 is OK, but level 2 not functionate!

H M

unread,
May 3, 2015, 10:37:44 AM5/3/15
to django...@googlegroups.com
hi, did you solved the problem?
Reply all
Reply to author
Forward
0 new messages