Would help if you showed your data models. Presumably the db.product table 
includes a reference field that references this table. That allows you to 
do a recursive select in reverse (see the last part of this 
section<http://web2py.com/books/default/chapter/29/06#Recursive-selects>). 
When you select a record from this table (let's call the record "r"), then 
r.product is a LazySet object that refers to all the records in db.product 
that have a reference to this particular record. You can then use that as 
any DAL Set object. If you need to further filter the set, you can add a 
condition by doing r.product(some_query), and if you want to select the 
records, you can do r.product.select(). Assuming there are potentially 
multiple product records that reference a given record in this table, it's 
not clear how you would want to use those records to construct the 
"represent" output for the field.

Anthony

On Tuesday, July 9, 2013 6:32:33 PM UTC-4, greenpoise wrote:
>
> I am getting this error. My grid works fine but when I try to log into the 
> database administration tool, I get this error. Any clue?
>
> File 
> "/home/xxx/Applications/web2py/applications/APPLICACION/models/db_catalog.py" 
> <http://127.0.0.1:8000/admin/default/edit/MOSAIC_POSx2/models/db_catalog.py>, 
> line 72, in <lambda>
>     Field('supptile',represent=lambda id, r: '%s%s'% 
> (r.supplier.suppliercode,r.product.tilename)),
> AttributeError: 'LazySet' object has no attribute 'tilename'
>
>
>
>

-- 

--- 
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/groups/opt_out.


Reply via email to