Ticket #4074: django-4074-admin-querystring-quote2.patch

File django-4074-admin-querystring-quote2.patch, 776 bytes (added by Robert Bunting, 17 years ago)

better unicode version

  • main.py

     
     1import urllib
    12from django import oldforms, template
    23from django.conf import settings
    34from django.contrib.admin.filterspecs import FilterSpec
     
    604605                del p[k]
    605606            elif v is not None:
    606607                p[k] = v
    607         return '?' + '&'.join([u'%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20')
     608        return '?' + '&'.join([u'%s=%s' % (urllib.quote(unicode(k)), urllib.quote(unicode(v))) for k, v in p.items()]).replace(' ', '%20')
    608609
    609610    def get_results(self, request):
    610611        paginator = ObjectPaginator(self.query_set, self.lookup_opts.admin.list_per_page)
Back to Top