Admin inlines and fieldsets

736 views
Skip to first unread message

Aymeric Augustin

unread,
Jun 20, 2011, 7:51:37 AM6/20/11
to django-d...@googlegroups.com
Hello,

Ticket #10938 [1] suggests declaring inlines in fieldsets, and was closed as wontfix.

I think this ticket mixes two different things:
    (1) make it possible to *declare* inlines in ModelAdmin.fieldsets instead of ModelAdmin.inlines. This is a bad idea: there should be only one way to declare inlines, and the current way is OK.
    (2) make it possible to *include* inlines in ModelAdmin.fieldsets (with a syntax that's still to be defined) in order to chose the position of the inlines in the change form. I think it's useful; actually, I need that right now.

Currently, inlines are added at the bottom of the change form — see templates/admin/change_form.html — and displaying them in another position involves re-ordering things with javascript or overriding the change form template. It would be easier if fieldsests accepted both fields and inlines in fieldsets.

Reading Russell's closing comment, it looks like he had (1) in mind but not (2). Does the wontfix also apply to (2)?

Best regards,

--
Aymeric Augustin.

Russell Keith-Magee

unread,
Jun 27, 2011, 10:00:47 AM6/27/11
to django-d...@googlegroups.com

Hi Aymeric,

Apologies for taking a while to get back to you on this.

You're correct -- I had (1) in mind when I wontfixed the ticket.
However, I can certainly see the merit in interpretation (2) providing
a way to include inlines in fieldsets as an organizational/ordering
mechanism. This general feature request (i.e., ordering of inlines
within normal field organization) is something that has been proposed
several times in the past -- in fact, I'd be surprised if there isn't
a couple of tickets relating to this.

Of course, the devil is in the details -- especially, in finding a
good syntax given that there isn't a name or label currently available
for referencing inlines...

Yours,
Russ Magee %-)

Stephen Burrows

unread,
Jun 28, 2011, 10:23:25 AM6/28/11
to Django developers
Hey,
I reopened the ticket and suggested a syntax that would make more
sense to me than the options already presented there.
Best,
Stephen

On Jun 27, 10:00 am, Russell Keith-Magee <russ...@keith-magee.com>
wrote:

Imposter

unread,
Dec 7, 2011, 8:47:38 PM12/7/11
to django-d...@googlegroups.com
This is exactly what I've been struggling with today!  Specifically the ordering of a related object.  More specifically the UserProfile created for User.  Currently I seemingly have no control in integrating with the admin form and am stuck with my User extension as a stacked inline appended to the bottom of the page, which is kind of a bummer because, for example, I've added middle name to the UserProfile but can't group it with the User first_name and last_name.  Unless of course I've completely missed something :P

Anyway, this has been a long-winded +1

Cptn Obvious

unread,
Dec 8, 2011, 11:42:51 PM12/8/11
to Django developers
You guys didn't hear? He actually needs that, "right now". If you
could just get that into trunk ASAP, that'd be great. I need a train
car filled with gold bars, while you're at it.

Jacob Kaplan-Moss

unread,
Dec 9, 2011, 9:05:30 AM12/9/11
to django-d...@googlegroups.com
On Thu, Dec 8, 2011 at 10:42 PM, Cptn Obvious <obvio...@gmail.com> wrote:
> You guys didn't hear? He actually needs that, "right now". If you
> could just get that into trunk ASAP, that'd be great. I need a train
> car filled with gold bars, while you're at it.

This sort of thing isn't OK here, at all. Cut it out.

Jacob

Reply all
Reply to author
Forward
Message has been deleted
0 new messages