[SQLObject] One to many relationships manipulation
SQLObject is a Python ORM.
Brought to you by:
ianbicking,
phd
From: Robert L. <ro...@le...> - 2004-08-16 07:15:23
|
Warning SQLObject (and Python) newbie question follows: I have a requirement to display the data from the 'many' side of a relationship (e.g. the addresses in a person-address) in an html table, where each column in the html table is one row from the 'many' table (i.e. each property of the address object is displayed in a new row of the same column). I have a working solution but it is not pretty and I wonder if there is an efficient SQLObject (or Pythonic way) to do this? An illustration may help. I need to go from: Person Address1(street, city, state, zip) Address2(street, city, state, zip) Address3(street, city, state, zip) Address4(street, city, state, zip) to: Person Address1.street Address2.street Address3.street Address4.street Address1.city Address2.city Address3.city Address4.city Address1.state Address2.state Address3.state Address4.state Address1.zip Address2.zip Address3.zip Address4.zip Robert |