Re: [sqlalchemy] mapping columns phone1, phone2, phone3 to a list-based property, phones

2010-08-03 Thread Michael Bayer
On Aug 3, 2010, at 1:05 PM, phrrn...@googlemail.com wrote: > Say you have a denormalized table with columns phone1, phone2, phone3 > and you would like to map the class so that the .phones property is an > iterable. > e.g. if I have data like > user_id, phone1, phone2, phone3 > 1, 1234, 5678, 901

[sqlalchemy] mapping columns phone1, phone2, phone3 to a list-based property, phones

2010-08-03 Thread phrrn...@googlemail.com
Say you have a denormalized table with columns phone1, phone2, phone3 and you would like to map the class so that the .phones property is an iterable. e.g. if I have data like user_id, phone1, phone2, phone3 1, 1234, 5678, 9012 2, 3456,7890,1234 I would like to say something like for p in S.query(