Comment 6 for bug 1704928

Revision history for this message
Balazs Gibizer (balazs-gibizer) wrote :

Based on SQLAlchemy doc [1] onupdate is not expected to be called during INSERT so not having update_at set in the first instance.update seem OK.

I traced the onupdate on the update_at column I can see [2] that the onupdate function is called in the second and any subsequent instance.save() but still the update_at field only updated at the third instance.save(). I followed Takashi's suspicion that sqlalchemy set the update_at field but the returned instance object is not updated with this change. So I added a direct instance query after instance.save() and it proved that the db contains an updated update_at field already at after the second instance.save() it is just not reflected in the instance object.

[1] https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/sql/schema.py#L1086
[2] http://paste.openstack.org/show/616274/