SQL Alchemy TypeDecorator

25 views
Skip to first unread message

Justvuur

unread,
Aug 9, 2022, 1:55:45 PM8/9/22
to sqlalchemy
Hi there,

Is there a way to pass/access model data for a row within the " process_result_value" method of a TypeDecorator?

For example, I want to decrypt the value but only if another value in the same model row is true/false.

Regards,
Justin


Jonathan Vanasco

unread,
Aug 9, 2022, 7:37:01 PM8/9/22
to sqlalchemy
This is usually done in the ORM with functions, and possibly hybrids.  

See https://docs.sqlalchemy.org/en/14/orm/mapped_attributes.html
Reply all
Reply to author
Forward
0 new messages