Kaydet (Commit) 6d6fe61b authored tarafından Luke Plant's avatar Luke Plant

Cleanups to related manager code, especially in use of closures.

The related manager classes are defined within functions, and the methods
had inconsistent and confusing usage of closures vs. parameters on self to
retrieve needed information. Everything is stored on self now.

Also some methods were not using super() where they should have been.

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16913 bcc190cf-cafb-0310-a4f2-bffc1f526a37
üst e3a6ac8f
......@@ -266,7 +266,7 @@ def create_generic_related_manager(superclass):
'%s__pk' % self.content_type_field_name : self.content_type.id,
'%s__exact' % self.object_id_field_name : self.pk_val,
}
return superclass.get_query_set(self).using(db).filter(**query)
return super(GenericRelatedObjectManager, self).get_query_set().using(db).filter(**query)
def add(self, *objs):
for obj in objs:
......
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