Saturday, March 28, 2015

Re: QueryDict and its .dict() method - why does it do that?

On Fri, Mar 27, 2015 at 2:50 PM, Carl Meyer <carl@oddbird.net> wrote:
> Hi Gabriel,
>
> On 03/27/2015 01:34 PM, Gabriel Pugliese wrote:
>> @Masklinn
>> That input is from jQuery's default serializer. It sends the data with
>> contentType 'application/x-www-form-urlencoded; charset=UTF-8'. I just
>> need to pass a data parameter with my JS Object (JSON) and it does the
>> magic.
>
> Yes, jQuery has chosen to adopt the same non-standard that Rails and PHP
> use for smuggling nested lists and objects through a flat querystring.

Let's be accurate here: what PHP, Rails, jQuery, et al. do is not
"non-standard". There's nothing wrong with their key-value pairs in
the query string. This is further illustrated by the fact that no
browser I am aware of has problems encoding them, and QueryDict has no
problem parsing them (it just doesn't do it with quite the same
result).

Perhaps it would be better to think about this issue as Plain Standard
and Enhanced Standard. Django does the bare basics of what is
required. PHP, Rails, jQuery, et al. go a little further in the
parsing. But there's absolutely nothing wrong with the choice they
made.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAD4ANxWWwFOE9mRWxgp-SoaCDds27vQTNVtt7LVKW7jVk07ysg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment