[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Anthony
> > def index(): > > login_form = auth.login() > if login_form.process(session=None,formname='login').accepted: > pass > elif login_form.errors: > response.write(request.vars) > return dict() > > to display the form I have used the SQLForm in HTML technique as menti

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Sushant Taneja
Thanks for an explanatory answer. I will try this out. On Monday, March 12, 2012 7:49:28 PM UTC+5:30, Anthony wrote: > > def index(): >> >> login_form = auth.login() >> if login_form.process(session=None,formname='login').accepted: >> pass >> elif login_form.errors: >>

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Sushant Taneja
I tried customizing the form. I have to set the id of the form element to login. To achieve the above I used the following statement in controller: login_form = auth.login() # Configure form properties login_form.attributes['_id']='login' But it's not working. The generated form does not contai

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Anthony
That should work. Can you show the view code? Also, note you can just do: login_form['_id'] = 'login' Anthony On Monday, March 12, 2012 1:19:45 PM UTC-4, Sushant Taneja wrote: > > I tried customizing the form. I have to set the id of the form element to > login. > To achieve the above I used th

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Sushant Taneja
Hi, I tried both but none seems to be working. Here's my view code: {{=login_form.custom.begin}} {{=login_form.custom.widget.email}} {{=logi

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Anthony
What's not working? When you view the HTML code of the rendered page in the browser, is the id not there, or is it just that some client-side CSS or JS isn't working as expected? If the latter, the problem could be that you have put the form beginning and ending code inside the tags rather tha

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Sushant Taneja
The rendered form is as: ... It has no attribute id. On Tuesday, March 13, 2012 12:05:02 AM UTC+5:30, Anthony wrote: > > What's not working? When you view the HTML code of the rendered page in > the browser, is the id not there, or is it just that some client-side CSS > or JS isn't working a

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Anthony
Hmm, works when I try it. Can you show the full controller code you have now? On Monday, March 12, 2012 2:46:57 PM UTC-4, Sushant Taneja wrote: > > The rendered form is as: > > > ... > > > It has no attribute id. > > On Tuesday, March 13, 2012 12:05:02 AM UTC+5:30, Anthony wrote: >> >> What's n

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Sushant Taneja
Hi, I found a workaround to the problem. I need to assign the id "login" to the form so that certain CSS and JS can be applied to the form elements. Since I was unable to assign id to the form, I assigned the id "login" to the table element. The login is now working. But another problem has su

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Anthony
> > I found a workaround to the problem. I need to assign the id "login" to > the form so that certain CSS and JS can be applied to the form elements. > Since I was unable to assign id to the form, I assigned the id "login" to > the table element. The login is now working. > Ah, I forget that

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-12 Thread Sushant Taneja
Hi, Ah, I forget that form.custom.begin is an XML object (more like a string) > and doesn't change when you directly manipulate the form object itself. You > could do: > > f.custom.begin = '%s id="login">' % f.custom.begin[:-1] > I added the above code line in controller. The attribute id was

[web2py] Re: Auth.user is still NULL after a successful login

2012-03-13 Thread Sushant Taneja
Hi, I studied the source code of auth.login() and found that all the validations are applied within the login method itself. The error message is automatically written to an element of class flash via setting session.flash to auth.messages.invalid_login. I modified my view code to include the