[web2py] Re: problem with list:reference

2020-07-20 Thread villas
Your model deletes the records and recreates them every time the model runs. This is not such a good idea for testing. Furthermore, it seems to retain the first product, but deletes the referenced keys. Your table ids are not reset to zero, so your first product will probably have missing k

[web2py] Re: Problem with list:reference

2011-03-17 Thread Massimo Di Pierro
You can use a nested select but it requires _select(db.table.field). You cannot pass a record as returned by .first() On Mar 17, 11:26 am, goutham v wrote: > thanks for the solution it worked. > but in doc > here > it

[web2py] Re: Problem with list:reference

2011-03-17 Thread goutham v
thanks for the solution it worked. but in doc here it asks to use the queried object directly? doesn't that way work?

[web2py] Re: Problem with list:reference

2011-03-16 Thread Massimo Di Pierro
Should be tag = db(db.tags.name=='testtag').select().first() q = db.branch.tags.contains(tag.id) branch = db(q).select().first() On Mar 16, 2:40 pm, goutham wrote: > = my model == > db.define_table('tags', >     Field('name','string', unique= True), >     format='%(name)s') > > db.define