#217 datetime validation is incorrect

closed-fixed
Oleg Broytman
None
5
2007-04-10
2007-04-08
No

on SQLObject-0.8.1 py2.4 with SQLite3

When set datetime value to DateCol, expect date spec string(as '2007-04-08'), but actual data is datetime spec string(as '2007-04-08 18:50:37.078000').

test code::

class SomeData(SQLObject):
date = DateCol()
datetime = DateTimeCol()

d = datetime.datetime.now()
v = SomeData(date=d.date(),datetime=d)

v.set(date=d, datetime=d)
assert str(v.datetime) == str(d) # raise
assert str(v.date) == str(d.date())

Discussion

  • Oleg Broytman
    Oleg Broytman
    2007-04-10

    • assigned_to: nobody --> phd
    • status: open --> closed-fixed
     
  • Oleg Broytman
    Oleg Broytman
    2007-04-10

    Logged In: YES
    user_id=4799
    Originator: NO

    Fixed in the revisions 2504-2508 in the 0.7 and 0.8 branches and in the trunk. The fix will be included in the next releases = 0.7.5, 0.8.2. Thank you!