> -----Original Message----- > From: sqlalchemy@googlegroups.com [mailto:sqlalchemy@googlegroups.com] > On Behalf Of espresso maker > Sent: 05 August 2011 06:19 > To: sqlalchemy > Subject: [sqlalchemy] data driven schema in sqlalchemy > > Hi there, > > I have a data driven database schema that I am trying to implement in > sqlalchemy. Here's how the tables look like: > > user > user_id | .... | .... > > user_properties > property_id | property_name | property_description > > user_properties_data > user_id | property_id | property_value > > What I would like to do eventually is if I have u = User() , u. > [some_propery_name] return the property_value if it exist for that > user. > > Any suggestions on how to implement this? >
There's an example of something like this in the SQLAlchemy repository: http://www.sqlalchemy.org/docs/orm/examples.html#vertical-attribute-mapp ing http://hg.sqlalchemy.org/sqlalchemy/file/3e75f284f253/examples/vertical I don't think it's exactly what you've described, but hopefully it's a starting point. Hope that helps, Simon -- 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.