[web2py] options widget causing web2py to stall with a table with >300k records

2012-12-04 Thread onetwomany
I have a table A that is referenced by another B using the standard reference type in web2py. db.define_table('A', ... field('name') ... ) db.define_table('B', ... field('A', db.A) ... ) Previously, everything was working fine but after importing a sizeable amount of records (>300k ro

[web2py] Re: options widget causing web2py to stall with a table with >300k records

2012-12-05 Thread onetwomany
f B.A comes from a A.id (represented by A.name) and you have > 300,000 options, you probably do not want a dropdown but you want > autocomplete. You just need: > > db.B.A.widget = SQLFORM.widgets.autocomplete(request, db.A.name, db.A.id) > > Massimo > > On Tuesday, 4 Decem

[web2py] Re: Selecting records that are not referenced by other records.

2013-09-24 Thread onetwomany
you can do that with > > all_courses = db(db.courses.id>0)._select(db.courses.memberid) > all_members_not_in_courses = db(~db.members.id.belongs(all_courses)) > > >> Would such an approach be computationally expensive particularly if the number of rows in courses is high? Perhaps the following r

[web2py] Re: Selecting records that are not referenced by other records.

2013-09-25 Thread onetwomany
Wednesday, September 25, 2013 2:56:09 PM UTC+8, Niphlod wrote: > > > > Il giorno mercoledì 25 settembre 2013 08:46:15 UTC+2, onetwomany ha > scritto: >> >> >> >> you can do that with >>> >>> all_courses = db(db.courses.id&