Hello,
On 05/05/20 23:26, Adam Johnson wrote:
request.GET and request.POST are misleadingly named:
- GET contains the URL parameters and is therefore available whatever
the request method. This often confuses beginners and “returners” alike.
- POST contains form data on POST requests, but not other kinds of data
from POST requests. It can confuse users who are posting JSON or other
formats.
[...]>
I therefore propose these renames:
- request.GET -> request.query_params (to match Django Rest Framework -
see below)
- request.POST -> request.form_data
- request.FILES -> request.files
- request.COOKIES -> request.cookies
- request.META -> request.meta
Yes please, query_params to match DRF makes a lot of sense to me!
These days i use mostly DRF views, still have to maintain plain Django code so
anything reducing the difference is much appreciated
Since these are very core attributes and the change would cause a huge
amount of churn, I propose not deprecating the old aliases immediately, but
leaving them in with a documentation note that they "may be deprecated."
Perhaps they can be like url() or ifequal which came up on the mailing list
recently - put through the normal deprecation path after a few releases
with such a note.
Given these are on most tutorial / book ever published on paper and on the
internet I'd just make them an alias of the new proposed names and kept for
quite a few.
Thanks
--
Riccardo Magliocchetti
@rmistaken
http://menodizero.it
--
You received this message because you are subscribed to the Google Groups "Django
developers (Contributions to Django itself)" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to django-developers+unsubscr...@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-developers/34ff0853-d984-65f3-c63c-71d32015963d%40gmail.com.