My problem probably is that i dont know python well to construct the
function . Following all examples and some examples from the
appliances , ii have a working program , based on the radio example of
yours, but no cimilar example or discussion inside the group , for
what i am trying to do .
def checkifthe datainside db.candidate.created_by_id is equal with
the curent_loggedin_user_id
if equal then redirect to show_candidate() function working
with crud.read
else redirect to edit_candidate() function with crud.update
so form can be executed for first time
return (what????)
I believe that my problem is not at the logical level but at coding
level , of creating a function that doesnot comes from another page
like comments on an existing wiki or blog page . I better say that my
python knowledge is small to fill up the details for such a function .
I ll apreciate if you could give me some of your precious time .
Thanks again
Sarados
On 14 Ιούλ, 01:23, sarsar <[email protected]> wrote:
> sory i pressed wrong button . I sent my message to you , so probably i
> have to responde again
>
> On 14 Ιούλ, 00:34, mdipierro <[email protected]> wrote:
>
> > 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 <[email protected]> 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 .