diff --git a/django/contrib/admin/models.py b/django/contrib/admin/models.py
index 23c8661..49ed868 100644
a
|
b
|
from django.contrib.auth.models import User
|
4 | 4 | from django.utils.translation import ugettext_lazy as _ |
5 | 5 | from django.utils.encoding import smart_unicode |
6 | 6 | from django.utils.safestring import mark_safe |
| 7 | from django.utils.html import urlquote |
| 8 | |
7 | 9 | |
8 | 10 | ADDITION = 1 |
9 | 11 | CHANGE = 2 |
… |
… |
class LogEntry(models.Model):
|
41 | 43 | def is_deletion(self): |
42 | 44 | return self.action_flag == DELETION |
43 | 45 | |
| 46 | |
44 | 47 | def get_edited_object(self): |
45 | 48 | "Returns the edited object represented by this log entry" |
46 | 49 | return self.content_type.get_object_for_this_type(pk=self.object_id) |
… |
… |
class LogEntry(models.Model):
|
50 | 53 | Returns the admin URL to edit the object represented by this log entry. |
51 | 54 | This is relative to the Django admin index page. |
52 | 55 | """ |
53 | | return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, self.object_id)) |
| 56 | return mark_safe(u"%s/%s/%s/" % (self.content_type.app_label, self.content_type.model, urlquote(self.object_id))) |
diff --git a/django/contrib/admin/templatetags/admin_list.py b/django/contrib/admin/templatetags/admin_list.py
index 1757906..e025de9 100644
a
|
b
|
from django.contrib.admin.views.main import ORDER_VAR, ORDER_TYPE_VAR, PAGE_VAR,
|
4 | 4 | from django.core.exceptions import ObjectDoesNotExist |
5 | 5 | from django.db import models |
6 | 6 | from django.utils import dateformat |
7 | | from django.utils.html import escape, conditional_escape |
| 7 | from django.utils.html import escape, conditional_escape, urlquote |
8 | 8 | from django.utils.text import capfirst |
9 | 9 | from django.utils.safestring import mark_safe |
10 | 10 | from django.utils.translation import get_date_formats, get_partial_date_formats, ugettext as _ |
… |
… |
def items_for_result(cl, result):
|
194 | 194 | # Convert the pk to something that can be used in Javascript. |
195 | 195 | # Problem cases are long ints (23L) and non-ASCII strings. |
196 | 196 | result_id = repr(force_unicode(getattr(result, pk)))[1:] |
| 197 | |
197 | 198 | yield mark_safe(u'<%s%s><a href="%s"%s>%s</a></%s>' % \ |
198 | | (table_tag, row_class, url, (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %s); return false;"' % result_id or ''), conditional_escape(result_repr), table_tag)) |
| 199 | (table_tag, row_class, urlquote(url), (cl.is_popup and ' onclick="opener.dismissRelatedLookupPopup(window, %s); return false;"' % result_id or ''), conditional_escape(result_repr), table_tag)) |
199 | 200 | else: |
200 | 201 | yield mark_safe(u'<td%s>%s</td>' % (row_class, conditional_escape(result_repr))) |
201 | 202 | |