that is the correct syntax. It will take effect any time an update()
construct is used or when the ORM updates a row. Because onupdate is
not a DDL-side construct, it will not take effect if you use a plain
text UPDATE statement or if the update is otherwise not emitted by the
SQLAlchemy application. The PassiveDefault, since it does represent
DDL, will work in this manner, but only if the table was created using
this table construct.
On Dec 6, 2008, at 4:50 AM, jo wrote:
>
> Hi all,
>
> I created a table with the following column:
>
> Column('last_updated', DateTime, PassiveDefault(func.current_timestamp
> ()), onupdate=func.current_timestamp())
>
> Maybe I don't understand how onupdate works.
> I would like to have this column to be changed every time the row is
> updated,
> but it doesn't work.
>
> thank you for any help
>
> j
>
>
>
>
>
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---