Kaydet (Commit) d03bc777 authored tarafından Malcolm Tredinnick's avatar Malcolm Tredinnick

Refs #1796 -- Fixed a problem when creating models with relations to

themselves: more than one instance was being created.


git-svn-id: http://code.djangoproject.com/svn/django/trunk@3510 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst 6ea0a13a
...@@ -25,7 +25,7 @@ def add_lookup(rel_cls, field): ...@@ -25,7 +25,7 @@ def add_lookup(rel_cls, field):
key = (module, name) key = (module, name)
# Has the model already been loaded? # Has the model already been loaded?
# If so, resolve the string reference right away # If so, resolve the string reference right away
model = get_model(rel_cls._meta.app_label,field.rel.to) model = get_model(rel_cls._meta.app_label, field.rel.to, False)
if model: if model:
field.rel.to = model field.rel.to = model
field.do_related_class(model, rel_cls) field.do_related_class(model, rel_cls)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment