#29439: InlineAdminFormSet worked with forms array, but don't asks fieldset from
every form in array
------------------------------------------------+------------------------
               Reporter:  danilovmy             |          Owner:  nobody
                   Type:  Cleanup/optimization  |         Status:  new
              Component:  contrib.admin         |        Version:  2.0
               Severity:  Normal                |       Keywords:
           Triage Stage:  Unreviewed            |      Has patch:  0
    Needs documentation:  0                     |    Needs tests:  0
Patch needs improvement:  0                     |  Easy pickings:  0
                  UI/UX:  0                     |
------------------------------------------------+------------------------
 in Django.contrib.admin.helpers.py (django 1.9)

 i think this is wrong, to use only **self.fieldsets**, every form can have
 own fieldset attribute.

 {{{
 class InlineAdminFormSet(object):
     def __iter__(self):
         for form, original in zip(self.formset.initial_forms,
 self.formset.get_queryset()):
             view_on_site_url = self.opts.get_view_on_site_url(original)
             yield InlineAdminForm(self.formset, form, *!!wrong!!*
 self.fieldsets *!!wrong!!*,
                 self.prepopulated_fields, original, self.readonly_fields,
                 model_admin=self.opts, view_on_site_url=view_on_site_url)
 ......
 }}}

 it should be something like this:

 {{{
 class InlineAdminFormSet(object):
         def __iter__(self):
                 for form, original in zip(self.formset.initial_forms,
 self.formset.get_queryset()):
                         yield InlineAdminForm(self.formset, form,
                                         *!!probably!!*
                                         [form.fieldset,] if hasattr(form,
 'fieldset') else self.fieldsets
                                         *!!probably!!*,
                                         self.prepopulated_fields,
 original, self.readonly_fields,
                                         model_admin=self.opts)
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29439>
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 unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/052.80d966127ecdb88d20b37da38bd71934%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to