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

<https://lh5.googleusercontent.com/-1vWqrnC5rYA/U04b4IPeb5I/AAAAAAAABsk/i15PphZaZHQ/s1600/Capture.PNG>

What is missing to show the ContractSubClause(s)?

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to django-users+unsubscr...@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/27ac4b42-072c-4e6a-b15d-2d7ef5c3967f%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to