1
0
mirror of https://github.com/django/django.git synced 2025-07-04 09:49:12 +00:00

unicode: Fixed a couple of places where IRI fragments are being used and need

to be converted correctly.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5284 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Malcolm Tredinnick 2007-05-19 00:19:17 +00:00
parent 3d74a68a51
commit 695a21ae7f
3 changed files with 4 additions and 4 deletions

View File

@ -7,7 +7,7 @@ certain test -- e.g. being a DateField or ForeignKey.
"""
from django.db import models
from django.utils.encoding import smart_unicode
from django.utils.encoding import smart_unicode, iri_to_uri
from django.utils.translation import ugettext as _
import datetime
@ -44,7 +44,7 @@ class FilterSpec(object):
for choice in self.choices(cl):
t.append(u'<li%s><a href="%s">%s</a></li>\n' % \
((choice['selected'] and ' class="selected"' or ''),
choice['query_string'] ,
iri_to_uri(choice['query_string']),
choice['display']))
t.append('</ul>\n\n')
return "".join(t)

View File

@ -3,6 +3,6 @@
<ul>
{% for choice in choices %}
<li{% if choice.selected %} class="selected"{% endif %}>
<a href="{{ choice.query_string }}">{{ choice.display|escape }}</a></li>
<a href="{{ choice.query_string|iriencode }}">{{ choice.display|escape }}</a></li>
{% endfor %}
</ul>

View File

@ -10,7 +10,7 @@
<ul class="objectlist">
{% for object in object_list %}
<li class="{% cycle odd,even %}"><a href="{{ object|urlencode }}/">{{ object|escape }}</a></li>
<li class="{% cycle odd,even %}"><a href="{{ object|iriencode }}/">{{ object|escape }}</a></li>
{% endfor %}
</ul>