On Wed 03 Sep 2008 03:33:23 PM EDT, Oleg Broytmann wrote: > On Wed, Sep 03, 2008 at 01:43:54PM +0000, Matthew Wilson wrote: >> I want to do a select like this with SQLObject: >> >> select * from people >> where date_part('day', createddate) = date '2008-09-01'; >> >> That query should choose people created any time on September 1st. >> >> In SQLObject, this is what I'm doing: >> >> People.select("date_part('day', createddate) = date '2008-09-01'") >> >> Is there some way to avoid using a string of raw SQL? > > Something like > > from sqlobject.sqbuilder import func > People.select(func.date_part('day', createddate) == '2008-09-01') > > 'func' is a pretty simple object whose attributes are passed unchanged > (unquoted, unescaped) to SQL. > > Oleg.
Oleg -- thanks so much for the help. You're a fantastic benefit to the SQLObject community. Matt ------------------------------------------------------------------------- This SF.Net email is sponsored by the Moblin Your Move Developer's challenge Build the coolest Linux based applications with Moblin SDK & win great prizes Grand prize is a trip for two to an Open Source event anywhere in the world http://moblin-contest.org/redirect.php?banner_id=100&url=/ _______________________________________________ sqlobject-discuss mailing list sqlobject-discuss@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss