#9025: Nested Inline Support in Admin
---------------------------------------------+------------------------------
          Reporter:  pixelcort               |         Owner:  nobody
            Status:  new                     |     Milestone:        
         Component:  django.contrib.admin    |       Version:  1.0   
        Resolution:                          |      Keywords:        
             Stage:  Design decision needed  |     Has_patch:  1     
        Needs_docs:  0                       |   Needs_tests:  1     
Needs_better_patch:  1                       |  
---------------------------------------------+------------------------------
Comment (by vosinh):

 Replying to [comment:9 vosinh]:
 > Replying to [comment:8 anonymous]:
 > > Replying to [ticket:9025 pixelcort]:
 > > > Currently, admin.TabularInline and admin.StackedInline do not
 support inlines themselves.
 > > >
 > > > This would allow nested inlines to happen.
 > >
 > > Has the attached patch been tested? Anything special in the admin.py
 configuration? It is not working for me, although the code with the patch
 was translated successfully.
 > > Thanks for a reply.
 >
 > I wrote it for a project with a very large number of tables (>100) and
 with 3 or 4 levels of relations depth between tables very often
 > and doing a specific admin page for every table set would be big work
 (20+ sets, and more could be added).
 > the code gives you the possibility to do multiple inlines like:
 >
 > class rab_Inline(TabularInline):
 >     model = rab
 >
 > class bar_Inline(TabularInline):
 >     model = bar
 >     inlines = [rab_Inline]
 >
 > class foo_Admin(AdminModel):
 >     model = foo
 >     inlines = [bar_Inline]
 >
 > with code like this in your admin.py you have the three tables in the
 foo object admin page
 > is this working for you? I tested it with 1.0 and 1.0.1. I'm going to
 upgrade to 1.0.3 soon and test with it too, but it should work
 >
 > the part that's missing from the patch is EDITING support. You are not
 able to edit. I took a look at it for a bit but since I dont need it i
 never implemented it.
 > I remember there's code that puts all the generated html form code in a
 list, but if you have multiple inlines the order is wrong and only the
 first added forms can work (the foo object form should work). Expanding
 that code should add editing support. If you are interest I can provide
 more details

 tested with 1.0 and 1.0.1 but not 1.0.2
 1.0.3 is typo

-- 
Ticket URL: <http://code.djangoproject.com/ticket/9025#comment:10>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to