Thread: [SQLObject] SQLObject / Interbase, generated SQL defective
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Frank W. <fra...@no...> - 2010-04-15 13:56:39
|
hi everyone! it´s been a while but i hope you will answer me. in a script i have a sqlobject query like this: r.BUCHUNGEN.filter((Gebucht.q.PERSONEN >= 4) & (Gebucht.q.OPTIONSDATUM is None)) this generates sql like this: SELECT gebucht.NR, [...] FROM gebucht WHERE ((((gebucht.REISENR) = ('10CAL/1604')) AND (((gebucht.STORNIERT) = ('NEIN')) OR ((gebucht.STORNIERT) IS NULL))) AND (((gebucht.PERSONEN) >= (4)) AND (0))) this won´t be executed by the interbase server, it doesn´t accept the last part "AND (0)" and dismisses the query. if i remove this last part it will execute just fine. is this a sqlobject-issue? or is it rather kinterbasdb related? thanks! frank |
From: Oleg B. <ph...@ph...> - 2010-04-15 14:20:46
|
On Thu, Apr 15, 2010 at 03:56:08PM +0200, Frank Wagner wrote: > (Gebucht.q.OPTIONSDATUM is None) (Gebucht.q.OPTIONSDATUM == None) Python allow to override == operator (__eq__ magic method) but not 'is'. Hence SQLObject can do symbolic manipulation with '== None' but cannot catch 'is None' - Python already passed False and SQLObject happily converts it to 0. Oleg. -- Oleg Broytman http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |
From: Frank W. <fra...@no...> - 2010-04-15 14:28:47
|
quick and precise as always :) thanks a lot oleg! Am 15.04.2010 um 16:20 schrieb Oleg Broytman: > On Thu, Apr 15, 2010 at 03:56:08PM +0200, Frank Wagner wrote: >> (Gebucht.q.OPTIONSDATUM is None) > > (Gebucht.q.OPTIONSDATUM == None) > > Python allow to override == operator (__eq__ magic method) but not 'is'. > Hence SQLObject can do symbolic manipulation with '== None' but cannot > catch 'is None' - Python already passed False and SQLObject happily > converts it to 0. > > Oleg. > -- > Oleg Broytman http://phd.pp.ru/ ph...@ph... > Programmers don't die, they just GOSUB without RETURN. > > ------------------------------------------------------------------------------ > Download Intel® Parallel Studio Eval > Try the new software tools for yourself. Speed compiling, find bugs > proactively, and fine-tune applications for parallel performance. > See why Intel Parallel Studio got high marks during beta. > http://p.sf.net/sfu/intel-sw-dev > _______________________________________________ > sqlobject-discuss mailing list > sql...@li... > https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss |