magic-removal: Changed Options.__repr__ to use object_name, not module_name (which is going away)
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2022 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
fd44a02a1a
commit
40d4782263
|
@ -89,7 +89,7 @@ class Options:
|
||||||
self.pk = field
|
self.pk = field
|
||||||
|
|
||||||
def __repr__(self):
|
def __repr__(self):
|
||||||
return '<Options for %s>' % self.module_name
|
return '<Options for %s>' % self.object_name
|
||||||
|
|
||||||
def get_content_type_id(self):
|
def get_content_type_id(self):
|
||||||
"Returns the content-type ID for this object type."
|
"Returns the content-type ID for this object type."
|
||||||
|
@ -101,9 +101,7 @@ class Options:
|
||||||
return self._content_type_id
|
return self._content_type_id
|
||||||
|
|
||||||
def get_field(self, name, many_to_many=True):
|
def get_field(self, name, many_to_many=True):
|
||||||
"""
|
"Returns the requested field by name. Raises FieldDoesNotExist on error."
|
||||||
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
|
to_search = many_to_many and (self.fields + self.many_to_many) or self.fields
|
||||||
for f in to_search:
|
for f in to_search:
|
||||||
if f.name == name:
|
if f.name == name:
|
||||||
|
|
Loading…
Reference in New Issue