I have this in my model:
sa.Column(u'created', sa.Date(), default=sa.func.now()),
sa.Column(u'updated', sa.Date(), onupdate=datetime.datetime.now),
But the dates don't get updated when I do:
langtable = [
"""INSERT INTO LANGUAGE (LANGID, NAME, LOCALES) VALUES (1, 'English',
'en')""",
.... etc
]
conn = engine.connect()
for row in langtable:
conn.execute(row)
for lang in session.query(db.Language).all():
print lang
Gives me:
Language(created=None, langid=1, locales=u'en', name=u'English',
updated=None)
I am doing this with sqlite database.
What am I doing wrong here?
Werner
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"sqlalchemy" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---