self._name = name
def __unicode__(self):
- return self.verbose_name
+ return unicode(self.verbose_name)
@property
def accessor(self):
# in anything useful.
name = self.name.replace('_', ' ')
- # Perhap use a model field's verbose_name
+ # Try to use a tmodel field's verbose_name
if hasattr(self.table.data, 'queryset'):
model = self.table.data.queryset.model
parts = self.accessor.split('.')
import django_tables2 as tables
from attest import Tests, Assert
from xml.etree import ElementTree as ET
+from django.utils.translation import ugettext_lazy as _
templates = Tests()
class CountryTable(tables.Table):
name = tables.Column()
- capital = tables.Column(sortable=False)
+ capital = tables.Column(sortable=False, verbose_name=_("Capital"))
population = tables.Column(verbose_name='Population Size')
currency = tables.Column(visible=False)
tld = tables.Column(visible=False, verbose_name='Domain')