from sqlobject import *
from sqlobject.sqlbuilder import *

__connection__ = "sqlite:/:memory:?debug=1"

from datetime import datetime

class Test(SQLObject):
  ts = DateTimeCol()


Test(ts=datetime.strptime('2008-08-01 21:44:33', '%Y-%m-%d %H:%M:%S'))

print list( == '2008-08-01'))

 2/QueryIns:  INSERT INTO test (ts) VALUES ('2008-08-01 21:44:33')
 2/QueryR  :  INSERT INTO test (ts) VALUES ('2008-08-01 21:44:33')
 3/QueryOne:  SELECT ts FROM test WHERE (( = (1))
 3/QueryR  :  SELECT ts FROM test WHERE (( = (1))
 4/Select  :  SELECT, test.ts FROM test WHERE ((date(test.ts)) = ('2008-08-01'))
 4/QueryR  :  SELECT, test.ts FROM test WHERE ((date(test.ts)) = ('2008-08-01'))
[<Test 1 ts='datetime.datetime...)'>]

  'func' is SQLBuilder's magic that passes its attribute to SQL unchanged.
Note 'date(test.ts)'! You should check that your backend actually
implements the function (for 'date' most do).

I am on Firebird right now. AFIK Firebird does not support 'date'.
The syntax which works is:

cast(test.ts as date) = '2008-08-01'

But Python does not accept following construction:

print list( as date) == '2008-08-01'))