class MyQueryDict(QueryDict):

    def __init__(self, query_string, mutable=False, encoding=None, order=None):
        super(MyQueryDict, self).__init__(query_string, mutable=False,
            encoding=None)
self.order = order

def lists(self):
    return [(key, [self[key]]) for key in self.order]
q = MyQueryDict('x=foo\xb3&y=bar(potato),z=hello world', order=order)
q.urlencode(safe='()')
Can I make Django QueryDict preserve ordering?