Hello! I have a model class Foo, with an auto-increment primary key.
When the model added to the session and the session is flushed, the primary key attribute becomes available as Foo.id. When Foo.id gets set by the ORM during the flush, I would like to trap that, and set another attribute that is derived from the value of the id. I've tried doing this via the set() method on an AttributeExtension, and also via an @validates decorator on the 'id' attribute. In both cases, I am getting into the set() method, or the @validates method -- I can set a breakpoint and inspect the model object, and set the value of the derived attribute -- but the derived value isn't readable after I into my app from the flush call, and the derived value doesn't persist. Does anyone know -- is there anyway to do what I'm trying to do? Do I need to manually mark the derived attribute as dirty or something, inside my set() or @validates method? thanks, --Bill -- 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.
