@alex:
yes, in my example above use auth signature.
please add :
*db._common_fields.append(auth.signature)*
in your db.py before you define auth table
a, i'm sorry, my mistake, thank you so much for correct me, anthony.
the code should be:
def search_shared_services():
* if db.SharedService.created_by==auth.user_id:*
grid = SQLFORM.smartgrid(db.SharedService,
linked_tables=['SharedServicePartnerIntersection'],
maxtextlength={'SharedServicePartnerIntersection.sharedServiceID':140,
'SharedService.shortSharedServiceTitle':140,'SharedService.shortSharedServiceDescription':140},
*editable=True, deletable=True*)
else:
grid = SQLFORM.smartgrid(db.SharedService,
linked_tables=['SharedServicePartnerIntersection'],
maxtextlength={'SharedServicePartnerIntersection.sharedServiceID':140,
'SharedService.shortSharedServiceTitle':140,'SharedService.shortSharedServiceDescription':140},
*editable=False, deletable=**False*)
return dict(grid=grid)
1 more question about
> Instead, you want to check if the request is to edit a record, and if so,
> whether that record was created by the current auth.user_id.
is it same auth.user_id with auth.user.id? is my code above is generate the
same result if i'm use auth.user.id?
--
---
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.