Django

Code

Show
Ignore:
Timestamp:
07/16/08 14:21:15 (4 months ago)
Author:
brosner
Message:

newforms-admin: Fixed #5490 -- Properly quote special characters in primary keys in the admin. Added tests to ensure functionality. This also moves quote and unquote to django/contrib/admin/util.py. Thanks jdetaeye and shanx for all your help.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • django/branches/newforms-admin/django/contrib/admin/models.py

    r6776 r7935  
    22from django.contrib.contenttypes.models import ContentType 
    33from django.contrib.auth.models import User 
     4from django.contrib.admin.util import quote 
    45from django.utils.translation import ugettext_lazy as _ 
    56from django.utils.encoding import smart_unicode 
     
    5152        This is relative to the Django admin index page. 
    5253        """ 
    53         return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, self.object_id)) 
     54        return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, quote(self.object_id)))