From: Jardel Weyrich Date: Thu, 27 May 2010 13:31:43 +0000 (-0300) Subject: Allow non-basestrings (e.g: ugettext_lazy) to be used in verbose_name. X-Git-Tag: 0.2~9 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=2deef446a86df45cb153280a41b64b743ff30992;p=django-tables2.git Allow non-basestrings (e.g: ugettext_lazy) to be used in verbose_name. --- diff --git a/django_tables/base.py b/django_tables/base.py index b08e061..686328a 100644 --- a/django_tables/base.py +++ b/django_tables/base.py @@ -2,7 +2,7 @@ import copy from django.http import Http404 from django.core import paginator from django.utils.datastructures import SortedDict -from django.utils.encoding import StrAndUnicode +from django.utils.encoding import force_unicode, StrAndUnicode from django.utils.text import capfirst from columns import Column from options import options @@ -318,7 +318,8 @@ class BoundColumn(StrAndUnicode): values = property(_get_values) def __unicode__(self): - return capfirst(self.column.verbose_name or self.name.replace('_', ' ')) + s = self.column.verbose_name or self.name.replace('_', ' ') + return capfirst(force_unicode(s)) def as_html(self): pass