Skip to content

Commit 4b1d979

Browse files
Merge pull request #108 from fbuccioni/admin-fixes
Admin fixes
2 parents bc9bf06 + 529a2ef commit 4b1d979

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

django_mongoengine/forms/document_options.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@ class DocumentMetaWrapper(object):
5353
model_name = None
5454
verbose_name = None
5555
has_auto_field = False
56+
abstract = False
5657
object_name = None
5758
proxy = []
5859
virtual_fields = []
@@ -114,8 +115,11 @@ def module_name(self):
114115
return self.model_name
115116

116117
def get_app_label(self):
117-
model_module = sys.modules[self.document.__module__]
118-
return model_module.__name__.split('.')[-2]
118+
if 'app_label' in self._meta:
119+
return self._meta['app_label']
120+
else:
121+
model_module = sys.modules[self.document.__module__]
122+
return model_module.__name__.split('.')[-2]
119123

120124
def get_verbose_name(self):
121125
"""

0 commit comments

Comments
 (0)