hi,

(from-svn (today) django), postgres

reverse-lookups on foreign keys does not work for me.

i even created a new empty project, and copied the example models from:

http://www.djangoproject.com/documentation/db_api/

into it, and tried the example reverse-query, and it did not work :-(

then i tried to run the tests in django,and they went ok.
even the reverse-lookup test :-(
again, copying the models.py used in that test into a new empty project 
does not work, i still get the error.

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


as i mentioned, when this query is executed in the test, it works fine.

any ideas what am i doing wrong? (except maybe trying to make this work 
at 23:46 :-))

thanks,
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to