Hello Anthony, I face some scaling issue with lazy_option plugin, but I am not sure I understand how the .join method you mention can help solve the issue...
I also customize lazy_option... I think the main problem with lazy_option is that it load all the data present in the reference table, so once your database start to be large it start to take a lot of time initializing all these rows... I think the way to workaround that would be to add a "load more" feature to lazy_option... Also, I am not sure that lazy_option is not load only once the form/DOM is loaded once, mean it get lazy just once the DOM have been initialize once, so not that lazy... Richard On Mon, Jul 4, 2016 at 11:19 PM, Anthony <[email protected]> wrote: > I'd say the first option is "lazy", as it defers the query until the data > are requested, but terminology aside, the DAL does not have built-in > functionality to handle the second option. Note, on the developers list, > Massimo has just proposed a .join method on Rows that would do something > similar, but with two queries instead of 3+. Alternatively, note that > .select() takes a "processor" argument, so I suppose you could implement a > custom processor that takes a query involving a join and instead of > returning the typical join result set returns a set of rows with nested > records. > > Anthony > > > On Monday, July 4, 2016 at 2:14:14 PM UTC-4, Carlos Cesar Caballero wrote: >> >> Hi, some ORMs have a lazy option for reduce queries when we ask for >> references, for example, something like: >> >> >> rows = db(db.mytable.id > 0).select() >> >> relation_name1 = rows[0].id_relation.name >> >> relation_name2 = rows[1].id_relation.name >> >> >> Will generate 3 querys, but with the lazy option, something like: >> >> >> rows = db(db.mytable.id > 0).select(lazy=true) >> >> relation_name1 = rows[0].id_relation.name >> >> relation_name2 = rows[1].id_relation.name >> >> >> Will generate only one query, and in that way the DAL will make the >> joins in the query and populate the reference rows. >> >> Is posible do something like this with pyDAL? >> >> Greetings. >> >> -- >> Este mensaje le ha llegado mediante el servicio de correo electronico que >> ofrece Infomed para respaldar el cumplimiento de las misiones del Sistema >> Nacional de Salud. La persona que envia este correo asume el compromiso de >> usar el servicio a tales fines y cumplir con las regulaciones establecidas >> >> Infomed: http://www.sld.cu/ >> >> -- > Resources: > - http://web2py.com > - http://web2py.com/book (Documentation) > - http://github.com/web2py/web2py (Source code) > - https://code.google.com/p/web2py/issues/list (Report Issues) > --- > You received this message because you are subscribed to the Google Groups > "web2py-users" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.

