#29431: inline_admin should have possibility don't generate empty inline form.
-------------------------------------+-------------------------------------
     Reporter:  danilovmy            |                    Owner:  nobody
         Type:                       |                   Status:  new
  Cleanup/optimization               |
    Component:  contrib.admin        |                  Version:
     Severity:  Normal               |               Resolution:
     Keywords:  InlineFormSet,       |             Triage Stage:
  optimization                       |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Description changed by danilovmy:

Old description:

> for example in admin.py:
>
> class my_model_inline(admin.StackedInline):
>         can_add_empty = False
>
> stacked.html after {% for inline_admin_form in inline_admin_formset %} :
> {% if opts.can_add_empty or not forloop.last %} - this helped don't call
> a formset.empty_form, if i dont need it.
>
> but it is better check it already in: InlineAdminFormSet.__iter__(self),
> last iteration.
> I think, it makes django better and give more speed.

New description:

 for example in admin.py:


 {{{
 class my_model_inline(admin.StackedInline):
         can_add_empty = False
 }}}



 {{{
 stacked.html after {% for inline_admin_form in inline_admin_formset %} :
 {% if opts.can_add_empty or not forloop.last %} - this helped don't call a
 formset.empty_form, if i dont need it.
 }}}

 but it is better check it already in: InlineAdminFormSet.__iter__(self),
 last iteration.
 I think, it makes django better and give more speed.

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/29431#comment:1>
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/067.36d78b04dda63024a8b669f39d72e81d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to