But when when a row is calculating it's virtual field, it will fetch the referenced row even when some other row from the initial set has already fetched this same referenced row (when they are referencing the same thing). So they will both perform the same fetch.
? I want to do this fetch 1x and use that record for all rows from the initial set that reference it. On Aug 15, 2013 4:18 PM, "Anthony" <abasta...@gmail.com> wrote: > On Thursday, August 15, 2013 10:04:45 AM UTC-4, Quint wrote: > >> thnx, >> >> but my goal is to prevent repeated queries for the same record when >> accessing ref fields on rows from the same result set. >> >> I'm missing something, how do those Virtual Fields achieve that? >> > > Yes, that's exactly what the virtual field does -- when the the Rows > object is created from the initial select, the value of the virtual field > is calculated for each Row, and it remains in the Row (i.e., it is not > re-calculated on each access). There is also Field.Method(), which does > re-calculate on every access (the advantage is that it is lazy, so nothing > is calculated until accessed -- and because of that, it can take arguments > at the time it is called). > > And about the join, wouldn't that mean it won't work on GAE? >> > > Oh, yeah, forgot you said you are on GAE. > > Anthony > > -- > > --- > You received this message because you are subscribed to a topic in the > Google Groups "web2py-users" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/web2py/IrAe-AGpiMU/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > web2py+unsubscr...@googlegroups.com. > For more options, visit https://groups.google.com/groups/opt_out. > -- --- 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 web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.