Ticket #4583: databrowser-unicode.diff

File databrowser-unicode.diff, 2.0 KB (added by anonymous, 17 years ago)
  • plugins/calendars.py

     
    66from django.utils.text import capfirst
    77from django.utils.translation import get_date_formats
    88from django.views.generic import date_based
     9from django.utils.encoding import force_unicode
    910import datetime
    1011import time
    1112
     
    2930        if not fields:
    3031            return u''
    3132        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()])
    3334
    3435    def urls(self, plugin_name, easy_instance_field):
    3536        if isinstance(easy_instance_field.field, models.DateField):
  • plugins/fieldchoices.py

     
    44from django.contrib.databrowse.sites import DatabrowsePlugin
    55from django.shortcuts import render_to_response
    66from django.utils.text import capfirst
    7 from django.utils.encoding import smart_str
     7from django.utils.encoding import smart_str, force_unicode
    88from django.views.generic import date_based
    99import datetime
    1010import time
     
    3333        if not fields:
    3434            return u''
    3535        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()])
    3737
    3838    def urls(self, plugin_name, easy_instance_field):
    3939        if easy_instance_field.field in self.field_dict(easy_instance_field.model.model).values():
Back to Top