Hi guys,

I just discovered column_property and I am trying to make a boolean 
property out of a table column.

Let's say I have this didactic table:

tblUsers = Table('users', metadata,
Column('user', Integer),
Column('type', Integer))

mapper(Users, tblUsers, properties =
dict(isSubcontractor = column_property(select([True], tblUsers.c.type == 
2)))

I want to have a property on the object that would say if the user is a 
subcontractor or not:

Users.isSubcontractor


I am not sure if this is column_property's fault or rather the way I am 
using select there.
Also, if there's a simpler way to do this I am thankful.

Thanks.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To post to this group, send email to sqlalchemy@googlegroups.com
To unsubscribe from this group, send email to 
sqlalchemy+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/sqlalchemy?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to