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:
Adrian Holovaty 2006-01-16 23:52:20 +00:00
parent fd44a02a1a
commit 40d4782263
1 changed files with 3 additions and 5 deletions

View File

@ -89,7 +89,7 @@ class Options:
self.pk = field
def __repr__(self):
return '<Options for %s>' % self.module_name
return '<Options for %s>' % self.object_name
def get_content_type_id(self):
"Returns the content-type ID for this object type."
@ -101,9 +101,7 @@ class Options:
return self._content_type_id
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
for f in to_search:
if f.name == name: