[web2py] Re: login problem

2011-07-10 Thread Anthony
Hmm, I tried the code you provided below (with ajax=True as well as with ajax=False/ajax_trap=True), and it worked fine for me (though I did have to set auth.settings.login_next=URL('default','login2') -- otherwise, the component redirects to the index page, which displays the entire index page

[web2py] Re: login problem

2011-07-10 Thread LightOfMooN
Also nothing happens On 10 июл, 02:42, Anthony wrote: > What happens if you remove vars=request.vars from LOAD()? > > On Jul 9, 11:52 am, LightOfMooN wrote: > > > > > > > > > ajax=True doesn't work too > > > I make it clear: > > layout.html > > {{=LOAD('default','login2',vars=request.vars, ajax=

[web2py] Re: login problem

2011-07-09 Thread Anthony
What happens if you remove vars=request.vars from LOAD()? On Jul 9, 11:52 am, LightOfMooN wrote: > ajax=True doesn't work too > > I make it clear: > layout.html > {{=LOAD('default','login2',vars=request.vars, ajax=True)}} > > default/login.html: > > {{=BEAUTIFY(request.vars)}} > {{if not auth.us

[web2py] Re: login problem

2011-07-09 Thread LightOfMooN
ajax=True doesn't work too I make it clear: layout.html {{=LOAD('default','login2',vars=request.vars, ajax=True)}} default/login.html: {{=BEAUTIFY(request.vars)}} {{if not auth.user:}} {{=form}} {{else:}} logout {{pass}} default.py: def login2(): form=auth.login() return dict(f

[web2py] Re: login problem

2011-07-09 Thread Anthony
Not sure what the problem is. Is your login view login.html or login.load? If the latter, your LOAD call should include 'login.load' (otherwise it will default to 'load.html'). You might also consider using the form.custom elements to build your form rather than doing everything manually, as d

[web2py] Re: login problem

2011-07-09 Thread LightOfMooN
So, I changed LOAD to {{=LOAD('default','login', vars=request.vars, ajax_trap=True, ajax=False)[0][0]}} but it stays not to log in. I add {{=BEAUTIFY(request.vars)}} in the default/login.html When I click on submit, I see, that vars contains just password, remember and username. There are no vars f

[web2py] Re: login problem

2011-07-09 Thread Anthony
Try adding ajax_trap=True to your LOAD call. Without that, your form will be posted to the action of the parent page, which is not prepared to process the login submission. ajax_trap=True will post the form submission back to the login() action. Or you can just use ajax=True for the login compon