Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fixed bug in [601]

git-svn-id: http://code.djangoproject.com/svn/django/trunk@604 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit 5d7c8a0c4fa9d8ffc60d064a67c069eea9064761 1 parent 4e2f910
@adrianholovaty adrianholovaty authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 django/core/meta/__init__.py
View
6 django/core/meta/__init__.py
@@ -309,7 +309,6 @@ def get_all_related_objects(self):
lookup_overrides={
'content_type__package__label__exact': self.app_label,
'content_type__python_module_name__exact': self.module_name,
- 'object_id__id__exact': None,
})
rel_objs.append((relatedlinks.RelatedLink._meta, link_field))
self._all_related_objects = rel_objs
@@ -926,7 +925,10 @@ def method_set_many_to_many(rel_field, self, id_list):
# Handles related-object retrieval.
# Examples: Poll.get_choice(), Poll.get_choice_list(), Poll.get_choice_count()
def method_get_related(method_name, rel_mod, rel_field, self, **kwargs):
- kwargs['%s__%s__exact' % (rel_field.name, rel_field.rel.to.pk.name)] = getattr(self, rel_field.rel.field_name)
+ if self._meta.has_related_links and rel_mod.Klass._meta.module_name == 'relatedlinks':
+ kwargs['object_id__exact'] = getattr(self, rel_field.rel.field_name)
+ else:
+ kwargs['%s__%s__exact' % (rel_field.name, rel_field.rel.to.pk.name)] = getattr(self, rel_field.rel.field_name)
kwargs.update(rel_field.rel.lookup_overrides)
return getattr(rel_mod, method_name)(**kwargs)
Please sign in to comment.
Something went wrong with that request. Please try again.