On Thu, Sep 4, 2008 at 2:08 PM, Jeff Forcier <[EMAIL PROTECTED]> wrote: > > I'm imagining the ability to have recursive inline editing: e.g. in a > simple hierarchy of Model C has FK to Model B has FK to Model A, when > viewing the admin form for Model A, to not only have Model B as an > inline, but to have Model C inlined inside the fieldset for Model B, > allowing you to set up a slice of that entire hierarchy in one go. > > First: is this currently possible? It doesn't appear to be, based on > poking around the API for the ModelAdmin hierarchy, nor does it seem > possible to achieve it via forms/formsets (as there's no easy way to > have a single form/formset represent >1 model at a time, AFAICT).
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 --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django developers" group. To post to this group, send email to django-developers@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-developers?hl=en -~----------~----~----~----~------~----~------~--~---