On Friday, September 6, 2013 7:51:54 PM UTC-4, Apple Mason wrote:
> Oops, I do have form.custom.begin and form.custom.end. I had forgotten to
> type it here.
>
> I also wanted a custom view for the registration, login, and whatever
> else, so my understanding is that I can do this by using
> form=auth.register() and form=auth.login(). Then in their respective views,
> I can format the html whatever way I want with form.custom.begin and
> form.custom.end.
>
You can also create a single view and include logic like this:
{{if request.args(0) == 'login':}}
[code to show login form]
{{elif request.args(0) == 'register':}}
[code to show register form]
{{else:}}
{{=form # use defaults for other forms}}
{{pass}}
Is form=auth.register() supposed to handle inserting the new user to the
> database? I've only dealt with handling it in the controller with 'if
> form.process().accepted', so looking at 'return(form=auth.register()) is a
> bit confusing.
>
Don't call form.process() with an Auth form -- the Auth method already
calls .process(), and calling it twice will lead to errors. Yes,
auth.register() does handle inserting the user into the database.
Anthony
--
---
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.