#26248: Make current WSGI request instance available in forms.ModelForm
instances.
--------------------------------+--------------------
Reporter: Dmitri-Sintsov | Owner: nobody
Type: New feature | Status: new
Component: Forms | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------
It is so much tiresome to add custom form classes everywhere to access
current request from form instances, especially in django.admin. Why
request instance is not available as ModelForm member instance by default?
ModelForm's may be instantiated in many different parts of application and
it's very useful to have self.request instance in forms.ModelForm.clean()
method.
Why it is not like that already? Aren't forms tied to requests and are
pretty much useless without requests? Anyway, if there is usage of
forms.ModelForm without WSGI request (I haven't seen such usage yet, it
seems untypical), one may have self.request = None in such case.
--
Ticket URL: <https://code.djangoproject.com/ticket/26248>
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/057.0ec0f80c73212fb2d3636460bdf0095c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.