Re: [sqlalchemy] One-to-one relationship as a boolean flag

2015-07-15 Thread Pedro Werneck
I thought maybe there was a simpler way to do that, but the hybrid_property works. Thanks. On Wed, Jul 8, 2015 at 11:19 AM, Mike Bayer mike...@zzzcomputing.com wrote: On 7/8/15 12:15 AM, Pedro Werneck wrote: Let's say I have a table 'user', and for backwards compatibility reasons I have a

Re: [sqlalchemy] One-to-one relationship as a boolean flag

2015-07-08 Thread Mike Bayer
On 7/8/15 12:15 AM, Pedro Werneck wrote: Let's say I have a table 'user', and for backwards compatibility reasons I have a single-column table named 'user_active' which is basically just a foreign key used as a boolean flag. I need my User model to have the 'active' field as a boolean

[sqlalchemy] One-to-one relationship as a boolean flag

2015-07-07 Thread Pedro Werneck
Let's say I have a table 'user', and for backwards compatibility reasons I have a single-column table named 'user_active' which is basically just a foreign key used as a boolean flag. I need my User model to have the 'active' field as a boolean mapped to that one-to-one relationship. So, I