#3444: Symmetrical Many-to-Many all() failing
----------------------------------+-----------------------------------------
Reporter:  [EMAIL PROTECTED]  |       Owner:  adrian          
  Status:  new                    |   Component:  Database wrapper
 Version:  SVN                    |    Keywords:                  
   Stage:  Unreviewed             |   Has_patch:  0               
----------------------------------+-----------------------------------------
 Hi, I've noticed that in the current development version, symmetrical
 many-to-many relationships can call all() AT MOST one time.  Using the
 supplied example supplied in the documentation, I get the following:
 
 {{{
 >>> from core.models import *
 >>> a = Person(name='Anne')
 >>> a.save()
 >>> b = Person(name='Bill')
 >>> b.save()
 >>> c = Person(name='Chuck')
 >>> c.save()
 >>> d = Person(name='David')
 >>> d.save()
 >>> a.friends.add(b,c)
 >>> d.friends.add(a,c)
 >>> a.friends.all()
 Traceback (most recent call last):
   File "<console>", line 1, in ?
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 101, in __repr__
     return repr(self._get_data())
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 444, in _get_data
     self._result_cache = list(self.iterator())
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 177, in iterator
     select, sql, params = self._get_sql_clause()
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 458, in _get_sql_clause
     joins2, where2, params2 = self._filters.get_sql(opts)
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 618, in get_sql
     joins2, where2, params2 = val.get_sql(opts)
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 669, in get_sql
     return parse_lookup(self.kwargs.items(), opts)
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 789, in parse_lookup
     joins2, where2, params2 = lookup_inner(path, lookup_type, value, opts,
 opts.db_table, None)
   File "/sw/lib/python2.3/site-packages/Django-0.95-
 py2.3.egg/django/db/models/query.py", line 890, in lookup_inner
     raise TypeError, "Cannot resolve keyword '%s' into field" % name
 TypeError: Cannot resolve keyword 'person' into field
 >>>
 }}}
 
 This problem does not exist in pre-0.96 Django distributions. As I am a
 Django newbie, there's not much I can do, but thanks for taking a look!

-- 
Ticket URL: <http://code.djangoproject.com/ticket/3444>
Django Code <http://code.djangoproject.com/>
The web framework for perfectionists with deadlines
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/django-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to