[sqlalchemy] MultipleResultsFound

2011-03-30 Thread jose soares

Hi all,

I got, for the first time the following error:

../lib/python2.6/site-packages/SQLAlchemy-0.6.0-py2.6.egg/sqlalchemy/orm/query.py,
 line 1417, in one
   Multiple rows were found for one())
MultipleResultsFound: Multiple rows were found for one()


Does anyone know what that means?

j


--
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] MultipleResultsFound

2011-03-30 Thread Mike Conley
You issued a query with a .one() qualifier and there is more than one row in
the database satisfying the condition.

Example: 2 names in a table
firstname=pete, lastname=smith
firstname=john, lastname=smith

query for rows lastname=smith with .one() will fail because there are 2
smith in database

-- 
Mike Conley

-- 
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.



Re: [sqlalchemy] MultipleResultsFound

2011-03-30 Thread jose soares

Mike Conley wrote:
You issued a query with a .one() qualifier and there is more than one 
row in the database satisfying the condition.


Example: 2 names in a table
firstname=pete, lastname=smith
firstname=john, lastname=smith

query for rows lastname=smith with .one() will fail because there 
are 2 smith in database


--
Mike Conley



but I'm not explicit using this .one() in my code...



Traceback (most recent call last):
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/_cphttptools.py,
 line 121, in _run
   self.main()
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/cherrypy/_cphttptools.py,
 line 264, in main
   body = page_handler(*virtual_path, **self.params)
 File string, line 3, in index
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/identity/conditions.py,
 line 246, in require
   predicate.eval_with_object(current, errors):
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/identity/conditions.py,
 line 88, in eval_with_object
   if p.eval_with_object(obj, None):
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/identity/conditions.py,
 line 171, in eval_with_object
   if self.permission_name in identity.permissions:
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/identity/base.py,
 line 173, in __getattr__
   return getattr(identity, name)
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/TurboGears-1.1.1-py2.6.egg/turbogears/identity/saprovider.py,
 line 76, in permissions
   p.permission_name for p in self.user.permissions)
 File /home/users/admin/release/sicer/BASE/controller/errorhandling.py, line 
33, in _get_user
   return saprovider.user_class.query.get(self.visit_link.user_id)
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/SQLAlchemy-0.6.0-py2.6.egg/sqlalchemy/orm/query.py,
 line 549, in get
   return self._get(key, ident)
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/SQLAlchemy-0.6.0-py2.6.egg/sqlalchemy/orm/query.py,
 line 1675, in _get
   return q.one()
 File 
/home/users/admin/.VE-SICER2.x-x86_64-19.04.2010/lib/python2.6/site-packages/SQLAlchemy-0.6.0-py2.6.egg/sqlalchemy/orm/query.py,
 line 1417, in one
   Multiple rows were found for one())
MultipleResultsFound: Multiple rows were found for one()

j

--
You received this message because you are subscribed to the Google Groups 
sqlalchemy group.
To post to this group, send email to sqlalchemy@googlegroups.com.
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en.