Fixed #12143 -- Corrected the naming of the 'to' column in recursive m2m models. Thanks to knutin@gmail.com for the report, and Alex Gaynor for the patch.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@11713 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
dab3e97c1a
commit
f9ead3fe42
|
@ -819,7 +819,7 @@ def create_many_to_many_intermediary_model(field, klass):
|
||||||
name = '%s_%s' % (klass._meta.object_name, field.name)
|
name = '%s_%s' % (klass._meta.object_name, field.name)
|
||||||
if field.rel.to == RECURSIVE_RELATIONSHIP_CONSTANT or field.rel.to == klass._meta.object_name:
|
if field.rel.to == RECURSIVE_RELATIONSHIP_CONSTANT or field.rel.to == klass._meta.object_name:
|
||||||
from_ = 'from_%s' % to.lower()
|
from_ = 'from_%s' % to.lower()
|
||||||
to = to.lower()
|
to = 'to_%s' % to.lower()
|
||||||
else:
|
else:
|
||||||
from_ = klass._meta.object_name.lower()
|
from_ = klass._meta.object_name.lower()
|
||||||
to = to.lower()
|
to = to.lower()
|
||||||
|
|
Loading…
Reference in New Issue