Hi!
I have a table like this
>>> t1 = Table('t1', metadata,
... Column('id', Integer, primary_key=True),
... Column('num', Integer, nullable=False),
... Column('change', DateTime, nullable=False,
... default=func.current_timestamp()))
and a class mapped to this table:
>>> class T1(object): pass
>>> mapper(T1, t1)
Is SA able to execute
UPDATE t1 SET change=CURRENT_TIMESTAMP() WHERE t1.id = ?
['2006-12-28 10:21:50', 1]
on session.flush() instead of
UPDATE t1 SET change=? WHERE t1.id = ?
['2006-12-28 10:21:50', 1]
?
My target is to set "change" field to time of UPDATE query
executing not when "change" propery was changed. And I know about
"onupdate" keyword of "Column()" but I need to update "change" field
only if I change mapped "change" property to any value.
Thank you!
--
DSS5-RIPE DSS-RIPN 2:550/[EMAIL PROTECTED] 2:550/[EMAIL PROTECTED]
xmpp:[EMAIL PROTECTED] mailto:[EMAIL PROTECTED] http://neva.vlink.ru/~dsh/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---