title: how to obtain all values of a multi-valued key from Django's request.GET QueryDict
body: <p>The Django docs say at <a href="http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.QueryDict.iteritems" rel="noreferrer">http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.QueryDict.iteritems</a> that<code>QueryDict.iteritems()</code> uses the same last-value logic as <code>QueryDict.__getitem__()</code>, which means that if the key has more than one value, <code>__getitem__()</code> returns the last value.</p>
  
  <p>Let's say <code>print request.GET</code> looks like this:</p>
  
  <p><code>&lt;QueryDict: {u'sex': [u'1'], u'status': [u'1', u'2', u'3', u'4']}&gt;</code></p>
  
  <p>If I want to get a string like <code>sex=1&amp;status=1&amp;status=2&amp;status=3&amp;status=4</code> (standard HTTP GET stuff) the following code won't give the desired results because of the <code>iteritems</code> behavior mentioned above:</p>
  
  <pre><code>mstring = []
  for gk, gv in request.GET.iteritems():
      mstring.append("%s=%s" % (gk, gv))
  print "&amp;".join(mstring)
  </code></pre>
  
  <p>What is the most efficient way to obtain the result that I want without too much looping?</p>
  
  <p>Regards.</p>
  
  <p>[EDIT]</p>
  
  <p>I should mention that I am not resorting to <code>QueryDict.urlencode()</code> because there are some keys in that request.GET that I don't want in the string. I could alter the string and take those key=value out, but just wondering if there is a better way to go about this. I realize this information should have been explicitly mentioned.</p>