Sunday, May 3, 2015

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

hi, did you solved the problem?

On Wednesday, April 16, 2014 at 7:59:10 AM UTC+2, Andreas Bloch wrote:

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

--
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+unsubscribe@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/ff032580-5505-46bb-b466-898b41207770%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment