#17856: Pass "obj" parameter to get_inline_instances
-------------------------------+------------------------------------
     Reporter:  ybon           |                    Owner:  nobody
         Type:  New feature    |                   Status:  new
    Component:  contrib.admin  |                  Version:  1.4
     Severity:  Normal         |               Resolution:
     Keywords:                 |             Triage Stage:  Accepted
    Has patch:  1              |      Needs documentation:  1
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  1              |                    UI/UX:  0
-------------------------------+------------------------------------
Changes (by quinode):

 * version:  1.4-beta-1 => 1.4
 * needs_tests:  1 => 0


Comment:

 Updated and tested patch (the add_view case had been omitted)
 The patch is really simple : it adds the obj parameter to the method, and
 passes it in the three only places where the get_inline_instances is
 called. And this makes it behave just like the other ModelAdmin method.

 More can be said about the need of an entry point here. [[BR]]
 For example, this is the only clean way I found
 (https://groups.google.com/forum/?fromgroups#!topic/django-
 users/l_nsr0_ea0o) to pass the parent object instances to inlines (Inline
 classes have to be modified to get the arg, but this is another possible
 enhancement once this one exists)[[BR]]
 You need to know which object you're working on when you need to filter an
 inline form field queryset based on the parent object, a rather common
 pattern...

-- 
Ticket URL: <https://code.djangoproject.com/ticket/17856#comment:10>
Django <https://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 django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en.

Reply via email to