On Monday, September 12, 2011 4:27:08 PM UTC-4, leftcase wrote: > > {{for i,row in enumerate(rows):}}{{if not i==0:}},{{pass}} > { lat: {{=row.lat}}, lng: {{=row.lon}}, name: "{{=row.provider.name}}" > } > {{pass}} > > ------------------------------------------------ > As you can see, the provider field in the data table stores the provider > id. > > I'm confused! > > Although this does work I don't know why!, is it the correct way to > reference the name field from the providers table? > Yes, that's a recursive select: http://web2py.com/book/default/chapter/06#Recursive-selects. Note, though, that it will do a new select for every row, so it is not efficient when processing many records. Instead, you should do a join: http://web2py.com/book/default/chapter/06#Inner-Joins.
Anthony