mirror of
https://github.com/django/django.git
synced 2025-07-04 17:59:13 +00:00
magic-removal: fixed a small bug (typo, really) in RelatedManager
git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2552 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
cb5e2764be
commit
0cfe7fe53e
@ -190,13 +190,13 @@ class ForeignRelatedObjectsDescriptor(object):
|
||||
obj.save()
|
||||
else:
|
||||
raise rel_field.rel.to.DoesNotExist, "'%s' is not related to '%s'." % (obj, instance)
|
||||
add.alters_data = True
|
||||
remove.alters_data = True
|
||||
|
||||
def clear(self):
|
||||
for obj in self.all():
|
||||
setattr(obj, rel_field.name, None)
|
||||
obj.save()
|
||||
add.alters_data = True
|
||||
clear.alters_data = True
|
||||
|
||||
manager = RelatedManager()
|
||||
manager.core_filters = {'%s__pk' % rel_field.name: getattr(instance, rel_field.rel.get_related_field().attname)}
|
||||
|
Loading…
x
Reference in New Issue
Block a user