- Timestamp:
- 07/16/08 14:21:15 (6 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
django/branches/newforms-admin/django/contrib/admin/views/main.py
r7881 r7935 1 1 from django.contrib.admin.filterspecs import FilterSpec 2 2 from django.contrib.admin.options import IncorrectLookupParameters 3 from django.contrib.admin.util import quote 3 4 from django.core.paginator import Paginator, InvalidPage 4 5 from django.db import models … … 30 31 # Text to display within change-list table cells if the value is blank. 31 32 EMPTY_CHANGELIST_VALUE = '(None)' 32 33 def quote(s):34 """35 Ensure that primary key values do not confuse the admin URLs by escaping36 any '/', '_' and ':' characters. Similar to urllib.quote, except that the37 quoting is slightly different so that it doesn't get automatically38 unquoted by the Web browser.39 """40 if type(s) != type(''):41 return s42 res = list(s)43 for i in range(len(res)):44 c = res[i]45 if c in ':/_':46 res[i] = '_%02X' % ord(c)47 return ''.join(res)48 33 49 34 class ChangeList(object):
