Re: [web2py] help needed for a query for one to many relation

2011-09-30 Thread Marin Pranjić
On Fri, Sep 30, 2011 at 9:10 AM, arutti wrote: > Hello, > > I'm trying to make this simple query > > SELECT a.*, s.* FROM account a, statement s WHERE a.nb = '2110' AND > (a.id = s.debit OR a.id = s.credit) > > Hi arutti, this should work: rows = db((db.account.nb == 2110) & ((db.account.id == d

[web2py] help needed for a query for one to many relation

2011-09-30 Thread arutti
Hello, I'm trying to make this simple query SELECT a.*, s.* FROM account a, statement s WHERE a.nb = '2110' AND (a.id = s.debit OR a.id = s.credit) with query, set, rows objects the tables are defined as follow: . db.define_table('account', Field('id','id', represent=lambda id