Re: [SQLObject] Distinct value lookup on DateTimeCol()
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Oleg B. <ph...@ph...> - 2007-06-13 10:41:07
|
On Wed, Jun 13, 2007 at 11:16:14AM +0200, F.A. Pinkse wrote: > class Birthday(sqlobject.SQLObject): > date = sqlobject.DateTimeCol(default=mx.DateTime.now()) Calling now() means the default will be calculated by Python once at the class creation time (usually during import). You certainly want date = sqlobject.DateTimeCol(default=mx.DateTime.now) This way Python passes to SQLObject a callable, and SQLObject will call it at a row creation time. > Now, I have all the date calculations available but... > how do I do my distinct value lookup on day, month and year? Using date/time functions that are provided by the database backend. Oleg. -- Oleg Broytmann http://phd.pp.ru/ ph...@ph... Programmers don't die, they just GOSUB without RETURN. |