#25831: django.views.generic.edit.FormMixinBase : get_form_with_form_class
wrapping
preventing custom method profiles for get_form()
-------------------------------+-------------------------
Reporter: LeGast00n | Owner: nobody
Type: Bug | Status: new
Component: Generic views | Version: 1.8
Severity: Normal | Keywords: forms views
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 1 | UI/UX: 0
-------------------------------+-------------------------
Hi there,
Django 1.8's FormMixinBase causes an issue for Views that implement a
custom method profile for get_form() : the wrapping function tolerates no
other argument than form_class.
Current implementation:
{{{
def get_form_with_form_class(self, form_class=None):
if form_class is None:
form_class = self.get_form_class()
return get_form(self, form_class=form_class)
}}}
Better implementation:
{{{
def get_form_with_form_class(self, form_class=None, *args,
**kwargs):
if form_class is None:
form_class = self.get_form_class()
return get_form(self, form_class=form_class, *args,
**kwargs)
}}}
cheers
--
Ticket URL: <https://code.djangoproject.com/ticket/25831>
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.41ea4372b6d00ef8e2eb5fe5a1cbfdbe%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.