Thread: [SQLObject] bug in selectBy when ID is one of the arguments
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Ksenia M. <kse...@gm...> - 2005-08-21 15:34:49
|
Hi, There is a bug in selectBy.=20 >>> peeps =3D Person.selectBy(id=3D1, lastName=3D"Doe")=20 produces query=20 SELECT person.id, person.first_name, person.last_name FROM person WHERE id = =3D 1 while I expect of course: SELECT person.id, person.first_name, person.last_name FROM person WHERE id =3D 1 AND last_name =3D 'Doe' (This double-check is actually pretty usefull for checking permissions, when an object is directly requested via an URL) --=20 Ksenia |
From: Oleg B. <ph...@ph...> - 2005-08-22 06:03:17
|
On Sun, Aug 21, 2005 at 05:34:03PM +0200, Ksenia Marasanova wrote: > There is a bug in selectBy. Arguable if it's a bug, but... > >>> peeps = Person.selectBy(id=1, lastName="Doe") > > produces query > > SELECT person.id, person.first_name, person.last_name FROM person WHERE id = 1 > > while I expect of course: > > SELECT person.id, person.first_name, person.last_name FROM person > WHERE id = 1 AND last_name = 'Doe' > > (This double-check is actually pretty usefull for checking > permissions, when an object is directly requested via an URL) ...I fixed it and commited at revision 934. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Ksenia M. <kse...@gm...> - 2005-08-22 06:53:39
|
Oleg, 2005/8/22, Oleg Broytmann <ph...@ph...>: >=20 > ...I fixed it and commited at revision 934. >=20 > Oleg. Thanks a bunch! --=20 Ksenia |