#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 | Resolution:
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Changes (by aaugustin):
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Comment:
> Why it is not like that already?
Because of loose coupling -- see the first paragraph of
https://docs.djangoproject.com/en/1.9/misc/design-philosophies/
----
You can write a middleware that stores the current request in a global
(thread-local) variable and access it from anywhere in your application.
Django doesn't provide this by default because committers don't think it's
a good design. But it takes less than 10 lines of code and nothing stops
you from doing it for your own use.
--
Ticket URL: <https://code.djangoproject.com/ticket/26248#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/072.d065d4c7b12c3353f05239ffccd2064f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.