I have have a grid with a left outer join. So the row objects look like
this:
<Row {'product': {'purchasecost': 72.0,
'monthlycost': 0.0,
'id': 92L,
'productname': 'Awesome Product'},
'product_offer_item': {'discount': 0.0,
'optional': True,
'id': 172L,
'quantity': 99L}}>
I am trying to use represent to make some of them editable. For the
optional checkbox it is like this:
db.product_offer_item.optional.represent = lambda value, row:
INPUT(_type='checkbox',
_checked=value,
_name='optional',
_id=row.product.id
)
and placed just before the grid is created. Now I am getting an Attribute
Error from adding the ID to the checkbox. If I just ad the whole row as the
ID it works and I get an ID which looks like the row object above (that's
where I copied the details from) but when I try to access the row data to
put the product.id as the ID it throws an error. I also can't access the
sub object product or product_offer_item, I get the same error.
With the left outer join, the product.id is present for all rows, the
product_offer_item details are not.
I haven't had this problem before and can't think of a way to add a row
unique identifier any other way.
Why am I getting an Attribute Error when I can clearly see the attributes.
--
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.