Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

unicode: Fixed #4583 -- Fixed a problem with displaying verbose names in

databrowse.


git-svn-id: http://code.djangoproject.com/svn/django/branches/unicode@5481 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 1bfcfe615c65565da5009a205aecff394217717c 1 parent d2080dd
@malcolmt malcolmt authored
View
3  django/contrib/databrowse/plugins/calendars.py
@@ -6,6 +6,7 @@
from django.utils.text import capfirst
from django.utils.translation import get_date_formats
from django.views.generic import date_based
+from django.utils.encoding import force_unicode
import datetime
import time
@@ -29,7 +30,7 @@ def model_index_html(self, request, model, site):
if not fields:
return u''
return u'<p class="filter"><strong>View calendar by:</strong> %s</p>' % \
- u', '.join(['<a href="calendars/%s/">%s</a>' % (f.name, capfirst(f.verbose_name)) for f in fields.values()])
+ u', '.join(['<a href="calendars/%s/">%s</a>' % (f.name, force_unicode(capfirst(f.verbose_name))) for f in fields.values()])
def urls(self, plugin_name, easy_instance_field):
if isinstance(easy_instance_field.field, models.DateField):
View
4 django/contrib/databrowse/plugins/fieldchoices.py
@@ -4,7 +4,7 @@
from django.contrib.databrowse.sites import DatabrowsePlugin
from django.shortcuts import render_to_response
from django.utils.text import capfirst
-from django.utils.encoding import smart_str
+from django.utils.encoding import smart_str, force_unicode
from django.views.generic import date_based
import datetime
import time
@@ -33,7 +33,7 @@ def model_index_html(self, request, model, site):
if not fields:
return u''
return u'<p class="filter"><strong>View by:</strong> %s</p>' % \
- u', '.join(['<a href="fields/%s/">%s</a>' % (f.name, capfirst(f.verbose_name)) for f in fields.values()])
+ u', '.join(['<a href="fields/%s/">%s</a>' % (f.name, force_unicode(capfirst(f.verbose_name))) for f in fields.values()])
def urls(self, plugin_name, easy_instance_field):
if easy_instance_field.field in self.field_dict(easy_instance_field.model.model).values():
Please sign in to comment.
Something went wrong with that request. Please try again.