title: Django Python urlencode same key with multiple values
body: <p>As the title suggest I am trying to urlencode using Ordered Dict in python</p>
  <pre class="lang-py prettyprint-override"><code>def url_replace(request, field, value, direction=&quot;&quot;):
      dict_ = request.GET.copy()
      if field == &quot;order_by&quot; and field in dict_.keys():
          if dict_[field].startswith(&quot;-&quot;) and dict_[field].lstrip(&quot;-&quot;) == value:
              dict_[field] = value
          elif dict_[field].lstrip(&quot;-&quot;) == value:
              dict_[field] = &quot;-&quot; + value
          else:
              dict_[field] = direction + value
      else:
          dict_[field] = direction + str(value)
  
      print(&quot;UNORDERED___________________&quot;)
      print(dict_)
      print(super(MultiValueDict, dict_).items())
      print(&quot;ORDERED_____________&quot;)
      print(OrderedDict(super(MultiValueDict, dict_).items()))
      print(OrderedDict(dict_.items()))
      return urlencode(OrderedDict(dict_.items()))
  </code></pre>
  <p>The output for the above code</p>
  <pre><code>UNORDERED___________________
  &lt;QueryDict: {'assigned_to_id': ['1', '2'], 'client_id': ['2', '1'], 'page': ['2']}&gt;
  dict_items([('assigned_to_id', ['1', '2']), ('client_id', ['2', '1']), ('page', ['2'])])
  OrderedDict([('assigned_to_id', '2'), ('client_id', '1'), ('page', '2')])
  ORDERED_____________
  OrderedDict([('assigned_to_id', ['1', '2']), ('client_id', ['2', '1']), ('page', ['2'])])
  OrderedDict([('assigned_to_id', '2'), ('client_id', '1'), ('page', '2')])
  </code></pre>
  <p>As you can see the assigned_to_id has only <code>2</code> in the end .</p>
  <p>What I am expecting is a ordered dict with</p>
  <pre><code>OrderedDict([('assigned_to_id', '2'),('assigned_to_id', '1'), ('client_id', '1'), ('client_id', '2'),('page', '2')])
  </code></pre>
  <p>Maybe there might be a better approach for this, I am a bit new to python</p>
  <p>My final aim is to return a dict with multiple keys or anything that can be used in urlencode</p>