#13683: Don't instantiate empty inline form when max_num is 0 ----------------------------------+----------------------------------------- Reporter: dalorin | Owner: dalorin Status: new | Milestone: Component: django.contrib.admin | Version: 1.2 Keywords: | Stage: Unreviewed Has_patch: 1 | ----------------------------------+----------------------------------------- Django 1.2 added dynamic addition of Inline forms in the admin interface. In order to support this functionality, InlineAdminFormSet constructs an extra InlineAdminForm using self.formset.empty_form. However, we have an Inline that displays a fixed set of controls and should never be constructed without the appropriate parameters.
The "Add another" javascript control can be hidden by specifying max_num = 0 on the Inline class. However, this does not prevent InlineAdminFormSet attempting to construct the blank form object. I am attaching a patch that changes this behaviour. -- Ticket URL: <http://code.djangoproject.com/ticket/13683> 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.
