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/ [EMAIL PROTECTED]
Programmers don't die, they just GOSUB without RETURN.
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
sqlobject-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/sqlobject-discuss