The Django docs say at http://docs.djangoproject.com/en/dev/ref/request-response/#django.http.QueryDict.iteritems thatQueryDict.iteritems() uses the same last-value
mstring = []
for key in request.GET.iterkeys(): # "for key in request.GET" works too.
# Add filtering logic here.
valuelist = request.GET.getlist(key)
mstring.extend(['%s=%s' % (key, val) for val in valuelist])
print '&'.join(mstring)