In this case I usually make editable=False and then make my own 'Edit' link 
button for just those records the user is allowed to change.


On Monday, December 17, 2012 8:09:47 PM UTC, Adi wrote:
>
> Is it possible to display all rows in grid, but make editable only a row 
> that belongs to a particular user? Tried searching if someone else did it, 
> but couldn't find any reference... 
>
> Tried following code, without success: 
>
> def check(row): return (row.created_by == 1) #auth.user_id
>
> def suppliers():
>    grid=SQLFORM.grid(q, ...
>         editable=lambda row: check(row),
>         # or, a second solution: 
>         # editable=lambda row: row.created_by==auth.user_id,
>
>
> A filter will do it, but all other rows will not be displayed, which is 
> not what I want:
>             db.supplier._common_filter = lambda query: 
> (db.supplier.created_by <>  auth.user_id)
>
>
> Thanks,
> Adnan
>
>

-- 



Reply via email to