[sqlalchemy] Restrict update and delete based on attribute

2016-07-26 Thread drMental
I'd like to restrict deletion and updates on an object based on the boolean attribute 'locked' on the same object. I've managed to successfully suppress updates but it doesn't seem to work for deletes with the following code. @listen_for(mapper, 'mapper_configured') def

[sqlalchemy] Enum referencing column

2015-10-29 Thread drMental
How do I get this use case working? I want the ticker attribute to retrieve the values from the value defined in the Enum column. class Security(Base): cusip = Column(String) sedol = Column(String) isin = Column(String) symbol = Column(String) _ticker =

[sqlalchemy] Re: Enum referencing column

2015-10-29 Thread drMental
Never mind, the hybrid_property was needed not declared_attr. My bad. On Thursday, 29 October 2015 11:46:32 UTC-7, drMental wrote: > > How do I get this use case working? I want the ticker attribute to > retrieve the values from the value defined in the Enum column. > > > c