Ticket #4583: databrowser-unicode.diff
File databrowser-unicode.diff, 2.0 KB (added by , 17 years ago) |
---|
-
plugins/calendars.py
6 6 from django.utils.text import capfirst 7 7 from django.utils.translation import get_date_formats 8 8 from django.views.generic import date_based 9 from django.utils.encoding import force_unicode 9 10 import datetime 10 11 import time 11 12 … … 29 30 if not fields: 30 31 return u'' 31 32 return u'<p class="filter"><strong>View calendar by:</strong> %s</p>' % \ 32 u', '.join(['<a href="calendars/%s/">%s</a>' % (f.name, capfirst(f.verbose_name)) for f in fields.values()])33 u', '.join(['<a href="calendars/%s/">%s</a>' % (f.name, force_unicode(capfirst(f.verbose_name))) for f in fields.values()]) 33 34 34 35 def urls(self, plugin_name, easy_instance_field): 35 36 if isinstance(easy_instance_field.field, models.DateField): -
plugins/fieldchoices.py
4 4 from django.contrib.databrowse.sites import DatabrowsePlugin 5 5 from django.shortcuts import render_to_response 6 6 from django.utils.text import capfirst 7 from django.utils.encoding import smart_str 7 from django.utils.encoding import smart_str, force_unicode 8 8 from django.views.generic import date_based 9 9 import datetime 10 10 import time … … 33 33 if not fields: 34 34 return u'' 35 35 return u'<p class="filter"><strong>View by:</strong> %s</p>' % \ 36 u', '.join(['<a href="fields/%s/">%s</a>' % (f.name, capfirst(f.verbose_name)) for f in fields.values()])36 u', '.join(['<a href="fields/%s/">%s</a>' % (f.name, force_unicode(capfirst(f.verbose_name))) for f in fields.values()]) 37 37 38 38 def urls(self, plugin_name, easy_instance_field): 39 39 if easy_instance_field.field in self.field_dict(easy_instance_field.model.model).values():