Ticket #4074: 4074-nfa.diff

File 4074-nfa.diff, 1.1 KB (added by Karen Tracey <kmtracey@…>, 16 years ago)

Same patch, only against newforms-admin

  • django/contrib/admin/views/main.py

     
    66from django.utils.encoding import force_unicode, smart_str
    77from django.utils.translation import ugettext
    88from django.utils.safestring import mark_safe
     9from django.utils.http import urlencode
    910import operator
    1011
    1112try:
     
    100101                if k.startswith(r):
    101102                    del p[k]
    102103        for k, v in new_params.items():
    103             if k in p and v is None:
    104                 del p[k]
    105             elif v is not None:
     104            if v is None:
     105                if k in p:
     106                    del p[k]
     107            else:
    106108                p[k] = v
    107         return mark_safe('?' + '&amp;'.join([u'%s=%s' % (k, v) for k, v in p.items()]).replace(' ', '%20'))
     109        return '?%s' % urlencode(p)
    108110
    109111    def get_results(self, request):
    110112        paginator = QuerySetPaginator(self.query_set, self.list_per_page)
Back to Top