gabor wrote: > > for example, with the reverse_lookup test models, this query fails: > > >>> User.objects.get(poll__question__exact="What's the first question?") > Traceback (most recent call last): > File "<console>", line 1, in ? > File "/Users/gabor/src/django/django/db/models/manager.py", line 66, > in get > return self.get_query_set().get(*args, **kwargs) > File "/Users/gabor/src/django/django/db/models/query.py", line 198, > in get > obj_list = list(clone) > File "/Users/gabor/src/django/django/db/models/query.py", line 94, in > __iter__ > return iter(self._get_data()) > File "/Users/gabor/src/django/django/db/models/query.py", line 383, > in _get_data > self._result_cache = list(self.iterator()) > File "/Users/gabor/src/django/django/db/models/query.py", line 159, > in iterator > select, sql, params = self._get_sql_clause() > File "/Users/gabor/src/django/django/db/models/query.py", line 397, > in _get_sql_clause > tables2, joins2, where2, params2 = self._filters.get_sql(opts) > File "/Users/gabor/src/django/django/db/models/query.py", line 528, > in get_sql > tables2, joins2, where2, params2 = val.get_sql(opts) > File "/Users/gabor/src/django/django/db/models/query.py", line 577, > in get_sql > return parse_lookup(self.kwargs.items(), opts) > File "/Users/gabor/src/django/django/db/models/query.py", line 682, > in parse_lookup > tables2, joins2, where2, params2 = lookup_inner(path, clause, > value, opts, opts.db_table, None) > File "/Users/gabor/src/django/django/db/models/query.py", line 785, > in lookup_inner > raise TypeError, "Cannot resolve keyword '%s' into field" % name > TypeError: Cannot resolve keyword 'poll' into field >
maybe this addition info helps: the model instances do have the reverse-"mapping". for example this works ok: u = User.objects.all()[0] u.poll_set.all() but as i said, this not: User.objects.get(poll__question__exact="What's the first question?") gabor --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Django users" group. To post to this group, send email to django-users@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/django-users -~----------~----~----~----~------~----~------~--~---