mirror of
https://github.com/jazzband/django-constance.git
synced 2026-03-16 22:40:24 +00:00
add config labels
This commit is contained in:
parent
2cec39d609
commit
40188c093a
2 changed files with 12 additions and 0 deletions
|
|
@ -309,6 +309,14 @@ class Config(object):
|
|||
def app_config(self):
|
||||
return apps.get_app_config(self.app_label)
|
||||
|
||||
@property
|
||||
def label(self):
|
||||
return '%s.%s' % (self.app_label, self.object_name)
|
||||
|
||||
@property
|
||||
def label_lower(self):
|
||||
return '%s.%s' % (self.app_label, self.model_name)
|
||||
|
||||
_meta = Meta()
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -104,3 +104,7 @@ class TestAdmin(TestCase):
|
|||
content_str.find('LONG_VALUE'),
|
||||
content_str.find('INT_VALUE')
|
||||
)
|
||||
|
||||
def test_labels(self):
|
||||
self.assertEqual(type(self.model._meta.label), str)
|
||||
self.assertEqual(type(self.model._meta.label_lower), str)
|
||||
|
|
|
|||
Loading…
Reference in a new issue