Re: [web2py] new experimental feature in trunk - rows.join(...)

2016-07-05 Thread Massimo Di Pierro
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',

Re: [web2py] new experimental feature in trunk - rows.join(...)

2016-07-05 Thread Carlos Cesar Caballero Díaz
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/

[web2py] new experimental feature in trunk - rows.join(...)

2016-07-05 Thread Massimo Di Pierro
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