#26248: Make current WSGI request instance available in forms.ModelForm
instances.
--------------------------------+--------------------------------------
Reporter: Dmitri-Sintsov | Owner: nobody
Type: New feature | Status: closed
Component: Forms | Version: master
Severity: Normal | Resolution: wontfix
Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
--------------------------------+--------------------------------------
Comment (by aaugustin):
You could certainly use a modelform without a request, for example to
validate data pulled from a CSV file before inserting it into the
database.
It's unclear to me why you need to pass a request to a modelform so often.
For me the frontier is materialized by `form = MyModelForm(request.POST)`.
While it's true that (model)forms are usually closer to request handling
than models, I'm not convinced coupling (model)forms to HTTP requests is
justified.
--
Ticket URL: <https://code.djangoproject.com/ticket/26248#comment:4>
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.1441b1757a765470cfc0149934dccfb1%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.