Since I couldn't find an existing ticket for nested or recursive
inlines in admin, I filed #9025.
I'm looking through the code but have not been able to find where I
could actually implement this.
On Sep 9, 2008, at 6:57 AM, Jeff Forcier wrote:
> Looks like my below post fell through the cracks; I'm hoping it's
> because everyone was busy preparing for DjangoCon, although I wouldn't
> blame people for skipping past my wall of text :) Does anyone have an
> opinion on recursive inline editing, one way or the other?
--
Cortland Klein <cort...@apple.com> +1 408 506 9791
Web Developer, Retail Training
Apple Inc.
10101 Bubb Rd.
Cupertino, CA 95014
http://apple.com/retail/
You're not missing anything. It isn't possible.
> Second: if not possible, is it desirable? I recognize that with any
> nontrivial hierarchy/number of extra objects per inline, the visual
> representation could become ghastly. But assuming its usage is limited
> to semi-trivial scenarios, it seems like the existing admin API could
> be very easily extended to support this. I haven't done serious
> investigation, but am thinking something like simply allowing/
> interpreting the 'inline' attribute on InlineModelAdmin (i.e. making
> InlineModelAdmin more closely resemble a subclass of ModelAdmin, which
> is probably the logical conclusion of this line of thought).
I'm pretty convinced that it isn't appropriate for the admin, but I'm
not convinced that something like that absolutely shouldn't be in
Django. It turns out that recursive inlines are hard. I tried pretty
hard to make it work in the early days of FormSets, but I couldn't get
all of the pieces moving in the right direction at the same time.
That said, I'm pretty stupid, and the fact that I couldn't figure
something out doesn't mean a whole lot. My suggestion to anyone who
wants to try this is to completely start over. Don't use the FormSet
code. It probably won't help you. Also, maybe take a look at
FormEncode. If I remember correctly, it can do such things.
I'd wager that none of the core devs are going to spend any time
implementing it, I certainly won't, but it would work just fine as a
third-party thing, and maybe with enough support could make it into
Django someday.
Joseph
Cheers,
Justin
This has come up a number of times over the years, and I still haven't
wrapped my head around why somebody would need this functionality...
Surely one could just use the "standard" admin for the third-level
objects, then use two-level inlines for the first- and second-level
objects?
Adrian
--
Adrian Holovaty
holovaty.com | everyblock.com | djangoproject.com