Ticket #6804: hack.diff
File hack.diff, 933 bytes (added by , 17 years ago) |
---|
-
django/db/models/sql/query.py
20 20 from django.core.exceptions import FieldError 21 21 from datastructures import EmptyResultSet, Empty, JoinError 22 22 from constants import * 23 from django.db.models.related import RelatedObject 23 24 24 25 try: 25 26 set … … 1004 1005 names = opts.get_all_field_names() 1005 1006 raise FieldError("Cannot resolve keyword %r into field. " 1006 1007 "Choices are: %s" % (name, ", ".join(names))) 1007 if not allow_many and (m2m or not direct) :1008 if not allow_many and (m2m or not direct) and not isinstance(field, RelatedObject): 1008 1009 for alias in joins: 1009 1010 self.unref_alias(alias) 1010 1011 raise JoinError(pos + 1)