magic-removal: Fixed _set_core_filter() call in db.models.fields.related

git-svn-id: http://code.djangoproject.com/svn/django/branches/magic-removal@2174 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-01-30 04:04:12 +00:00
parent 4d3763123a
commit b3e9732eff
1 changed files with 2 additions and 2 deletions

View File

@ -114,9 +114,9 @@ class ManyRelatedObjectsDescriptor(object):
rel_field = self.related.field
if self.rel_type == 'o2m':
manager._set_core_filter(**{'%s__%s__exact' % (rel_field.name, rel_field.rel.to._meta.pk.name): getattr(instance, rel_field.rel.get_related_field().attname)})
manager.core_filters.update({'%s__%s__exact' % (rel_field.name, rel_field.rel.to._meta.pk.name): getattr(instance, rel_field.rel.get_related_field().attname)})
else:
manager._set_core_filter(**{'%s__%s__exact' % (rel_field.name, instance_type._meta.pk.name): instance._get_pk_val()})
manager.core_filters.update({'%s__%s__exact' % (rel_field.name, instance_type._meta.pk.name): instance._get_pk_val()})
# Prepare the manager.
# TODO: Fix this hack?