Re: How to move inline into or above fieldsets in django admin?
Hello,
A late reply to say that I just pushed a fairly clean solution to this problem in one of my projects: https://github.com/dezede/dezede/commit/ed13ccaf34494e71fd913fd785c229052f6acdc8.
The idea is to define fieldsets_and_inlines_order in your ModelAdmin(s), an iterable of 'f' and 'i' characters (for "fieldset" and "inline") that specifies the order between the first fieldsets and inlines. If len(fieldsets_and_inlines_order) < len(fieldsets) + len(inlines), the remaining follows the original behaviour (fieldsets first, then all inlines).
Example: you have 5 fieldsets and 3 inlines, defining fieldsets_and_inlines_order = ('f', 'f', 'i', 'f', 'i') will give you:
- fieldset
- fieldset
- inline
- fieldset
- inline
- fieldset
- fieldset
- inline
Hope it helps,
Bertrand
-- 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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home