Using a grid with a join, I'd like to have user edit only records they
created.
How do you let grid know which table you want to edit when there are
multiple tables in the join?
Error received is: 'Row' object has no attribute 'created_by'
If you can, please type the answer using example below.
@auth.requires_login()
def manage_party_addresses():
is_owner = (lambda row: row.created_by == auth.user_id) if auth.user
else False
query =(db.PartyAddressIntersection.partyID==db.Party.id) &
(db.PartyAddressIntersection.addressID==db.Address.id) &
(db.PartyAddressIntersection.addressTypeID==db.AddressType.id)
grid = SQLFORM.grid(query, editable=is_owner, deletable=is_owner,
user_signature=True)
return dict(grid = grid)
thanks,
Alex Glaros
--
---
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.