예제 #1
0
 def title(self):
     if self._title is not None:
         return self._title
     try:
         return get_verbose_name(self.model, self.attr)
     except AttributeError:
         return self.attr.split(".")[-1].replace("_", " ").title()
예제 #2
0
 def title(self):
     if self._title is not None:
         return self._title
     try:
         return get_verbose_name(self.model, self.attr)
     except AttributeError:
         return self.attr.split(".")[-1].replace("_", " ").title()
예제 #3
0
def test_get_verbose_name():
    l = get_verbose_name(SimpleDemoModel, 'char')
    assert l == 'Character'
예제 #4
0
def test_get_verbose_name():
    l = get_verbose_name(SimpleDemoModel, 'char')
    assert l == 'Character'