summaryrefslogtreecommitdiff
path: root/django/db/models/base.py
diff options
context:
space:
mode:
authorMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-03 05:53:50 +0000
committerMalcolm Tredinnick <malcolm.tredinnick@gmail.com>2008-09-03 05:53:50 +0000
commit780f239fa7f8223c6e1513243584dda87d1acc3a (patch)
tree22a8ff8e7b96cbfa065b6210379df7cf14892774 /django/db/models/base.py
parent43f901e581c7ab5707038eaff0bc90c59cc29be1 (diff)
Fixed #8825 -- Fixed a small error model field setup (on the model class) from
r8855. Patch from Christofer Bernander. Test based on one from cgrady. git-svn-id: http://code.djangoproject.com/svn/django/trunk@8908 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/models/base.py')
-rw-r--r--django/db/models/base.py12
1 files changed, 6 insertions, 6 deletions
diff --git a/django/db/models/base.py b/django/db/models/base.py
index e23369bb67..da3d0e77f2 100644
--- a/django/db/models/base.py
+++ b/django/db/models/base.py
@@ -87,13 +87,13 @@ class ModelBase(type):
# Things without _meta aren't functional models, so they're
# uninteresting parents.
continue
-
+
# All the fields of any type declared on this model
new_fields = new_class._meta.local_fields + \
- new_class._meta.many_to_many + \
+ new_class._meta.local_many_to_many + \
new_class._meta.virtual_fields
field_names = set([f.name for f in new_fields])
-
+
# Concrete classes...
if not base._meta.abstract:
if base in o2o_map:
@@ -106,7 +106,7 @@ class ModelBase(type):
auto_created=True, parent_link=True)
new_class.add_to_class(attr_name, field)
new_class._meta.parents[base] = field
-
+
# .. and abstract ones.
else:
# Check for clashes between locally declared fields and those on the ABC.
@@ -127,7 +127,7 @@ class ModelBase(type):
if not val or val is manager:
new_manager = manager._copy_to_model(new_class)
new_class.add_to_class(mgr_name, new_manager)
-
+
# Inherit virtual fields (like GenericForeignKey) from the parent class
for field in base._meta.virtual_fields:
if base._meta.abstract and field.name in field_names:
@@ -136,7 +136,7 @@ class ModelBase(type):
'abstract base class %r' % \
(field.name, name, base.__name__))
new_class.add_to_class(field.name, copy.deepcopy(field))
-
+
if abstract:
# Abstract base models can't be instantiated and don't appear in
# the list of models for an app. We do the final setup for them a