thanks for reply.
I tried modifying the controller as per the company model that you provided
earlier. But I am getting following error :
<type 'exceptions.AttributeError'> 'DAL' object has no attribute 'auth'
Sorry for this basic question, but I am a beginner to web2py. Hope you can
help me to resolve this issue. So my models are exactly same as you
provided and controller looks like :
@auth.requires_login()
def rent():
created_by_user=db.company.created_by == db.auth.user.id
grid=SQLFORM.grid(db.company, user_signature=False,
editable=created_by_user, deletable=created_by_user)
return locals()
On Monday, March 25, 2013 11:11:39 AM UTC+5:30, 黄祥 wrote:
>
> please use query : *db.person.created_by == db.auth.user.id* in your grid.
> e.g.
> @auth.requires_login()
> def person():
> created_by_user=db.person.created_by == db.auth.user.id
> grid=SQLFORM.grid(db.person, user_signature=False,
> editable=created_by_user, deletable=created_by_user)
> return locals()
>
> or you can try :
> @auth.requires_login()
> def person():
> query=db.person.created_by == db.auth.user.id
> grid=SQLFORM.grid(query, user_signature=False)
> return locals()
>
> hope this can help
>
--
---
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.