mirror of
https://github.com/django/django.git
synced 2025-10-26 23:26:08 +00:00
Fixes #1812 -- Added model validity checks to ensure that models.py exists, and has been successfully imported for all INSTALLED_APPS. Previous behaviour was to silently ignore empty/problem models, which resulted in the display of an admin page that doesn't display a supposedly installed model. Thanks to Ian Holsman for the original report.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@3201 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
@@ -87,7 +87,10 @@ class Options(object):
|
||||
|
||||
def __repr__(self):
|
||||
return '<Options for %s>' % self.object_name
|
||||
|
||||
|
||||
def __str__(self):
|
||||
return "%s.%s" % (self.app_label, self.module_name)
|
||||
|
||||
def get_field(self, name, many_to_many=True):
|
||||
"Returns the requested field by name. Raises FieldDoesNotExist on error."
|
||||
to_search = many_to_many and (self.fields + self.many_to_many) or self.fields
|
||||
|
||||
Reference in New Issue
Block a user