say you have this....

create_by=Field('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
by')

db.define_table('atable,Field('data'),created_by)

you can retrieve rows created by the current user with

rows=db(db.atable.created_by==auth.user_id).select()

On 13 Lug, 16:27, sarsar <sarsara...@gmail.com> wrote:
>   Hi , maybe because it is to late here , or because i am rather old
> and slow learning , i am in front of a problem i cannot find the
> solution . As i dont now python , i cannot combine something that
> logicaly is very simple and easy to do , but i can find the correct
> code to do it .  I declare a candidate with many fields and one field
> is ...
> ('created_by',db.auth_user,default=auth.user_id,writable=False,label=T('created
> by') .
>    I want each user to login (after registration) and fill up the form
> ONCE .  If the user has filled up the form , then he can only see his
> own data . and if he tries to see again the form then he has to be
> redirected again to index page . I have understanded that i have to
> check and compare the current logged user with the field inside the
> db.candidate.created_by But i cant do the coding . one small example
> would help me . Thanks in advance .

Reply via email to