Turns out I had to make some change but I got this to work:
db.define_table('person',Field('name'))
db.define_table('product',Field('name'))
db.define_table('purchase',Field('person','reference person'),Field(
'product',
Massimo, that's great!!
Could work with multiple levels of relations? Giving something like:
{"owner": {"id": 1, "name": "Max", "owner_of_owner":{"id": 1, "data":
"the data"}}, "id": 1, "name": "Max's Chair"}
Or can be used to build that
(https://groups.google.com/d/topic/web2py/89byxw7BYwc/
db = DAL()
db.define_table('person',Field('name'))
db.define_table('thing',Field('name'),Field('owner','reference person'))
for name in ('Max','Tim','Jim'):
i = db.person.insert(name=name)
for thing in ('Chair','Table','Bike'):
db.thing.insert(owner=i, name=name+"'s "+thin
3 matches
Mail list logo