Fieldsets in Admin Inline

597 views
Skip to first unread message

Juergen Schackmann

unread,
Jul 25, 2011, 5:57:22 PM7/25/11
to django...@googlegroups.com
Hi all,
is there a way to define fieldsets in the Inline?
If could not find anything in the docs, but to me the idea sounds quite reasonable; so I am wondering if I just dont find it?!?!?!
Thanks
Juergen

Micky Hulse

unread,
Jul 25, 2011, 6:42:05 PM7/25/11
to django...@googlegroups.com

Not tested myself, but have you tried the normal fieldsets = () in a
standard admin.StackedInline class?

Found this via a quick Goog search:

http://www.softwarematrix.cn/blog/django/add-fieldsets-with-admin-stackedinline

Seems like that should work... I normally don't used the "Stacked"
look for my inlines, so hopefully I don't send you down the wrong
path.

Juergen Schackmann

unread,
Jul 26, 2011, 5:38:52 PM7/26/11
to django...@googlegroups.com
thanks a lot for googling this link (somehow google decided to hide it from me :-) )
it works for me!

just one word warning with the link: the code as described does not work for me, since the parent Admin refers to field in its fieldsets attribute that refer to the child and this raises the error: 

ImproperlyConfigured at ...

MetaModelAdmin.fieldsets[2][1]['fields']' refers to field 'type' that is missing from the form
after removing the specific field and only leave it in the fieldsets of the Inline, everything is working fine

Micky Hulse

unread,
Jul 26, 2011, 6:41:37 PM7/26/11
to django...@googlegroups.com
Awesome! Glad that helped and thanks for the warning. One of these
days I will need this functionality myself. :)

Have a great day!

Cheers,
Micky

Reply all
Reply to author
Forward
0 new messages