Is this what you are looking for?

from django.http import QueryDict
from collections import OrderedDict

class OrderedQueryDict(QueryDict, OrderedDict):
    pass

my_dict = OrderedQueryDict(request.META['QUERY_STRING'])

print my_dict.items()



On Friday, January 5, 2018 at 5:07:41 PM UTC+2, Ole Laursen wrote:
>
> Hi!
>
> Would it be possible to derive QueryDict (i.e. MultiValueDict) from an 
> OrderedDict instead of dict?
>
> I'm finding it increasingly irritating that the original order is kept by 
> the whole stack right until Django puts it into a dict. It makes some 
> highly dynamic form situations more tedious to handle.
>
> Now that Python 3.6 preserves the order of dicts as an implementation 
> detail, there should not be any performance overhead as far as I'm aware.
>
>
> Ole
>

-- 
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 post to this group, send email to django-developers@googlegroups.com.
Visit this group at https://groups.google.com/group/django-developers.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-developers/1913a9a7-e2e2-4373-8486-7ffd9bbf53fd%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to