Very useful feature (from my point of view) is that you can define
only one template outside the actions - response.view='%s/
default.html' % request.controller - and it becomes the default one
for all actions in a given controller.

On Apr 2, 10:54 am, Kacper Krupa <pageno...@gmail.com> wrote:
> 3)
> def login(): return auth.login()
> # create view "default/login.html"
> def register(): return auth.register()
> # create view "default/register.html"
> etc etc
>
> function should returns dict objects (then the templates are loaded
> afaik). So: def login(): dict(form=auth.login()) etc.
>
> On Apr 2, 6:54 am, Vidul Petrov <vidul.r...@gmail.com> wrote:
>
>
>
> > 2)
>
> > controller "default.py"
>
> > def user():
> >     if request.args:
> >         response.view='user/default.html'
> >     return dict(form=auth())
>
> > (to customize the view)
>
> > view "user/default.html"
>
> > {{extend 'layout.html'}}
>
> > {{=form}}
>
> > On Apr 2, 6:44 am, TheDude <officed...@gmail.com> wrote:
>
> > > 3)
> > > def login(): return auth.login()
> > > # create view "default/login.html"
> > > def register(): return auth.register()
> > > # create view "default/register.html"
> > > etc etc
> > > I tried this method but no luck. It doesnt even show any kind of file
> > > (not even generic.html) It just shows the HTML of the form. Any ideas
> > > why?
>
> > > On Apr 1, 11:06 pm, Yarko Tymciurak <yark...@gmail.com> wrote:
>
> > > > On Wed, Apr 1, 2009 at 9:56 PM, mdipierro <mdipie...@cs.depaul.edu> 
> > > > wrote:
>
> > > > > You have 3 options (assuming default.py controller)
>
> > > > > 1)
> > > > > def user(): return auth()
> > > > > # create a single view called default/user.html for all urls
>
> > > > > 2)
> > > > > def user():
> > > > >    if request.args: response.view='user/%s.html' % request.args[0]
> > > > >    return auth()
> > > > > # create individual views 'default/user/login.html' etc.
>
> > > > > 3)
> > > > > def login(): return auth.login()
> > > > > # create view "default/login.html"
> > > > > def register(): return auth.register()
> > > > > # create view "default/register.html"
> > > > > etc etc
>
> > > > by the way, if you are going to do special stuff, your code will 
> > > > probably be
> > > > more explicit / readable w/ (3).
>
> > > > > Massimo
>
> > > > > On Apr 1, 9:26 pm, TheDude <officed...@gmail.com> wrote:
> > > > > > I've tried using Web2Py's auth system and then tried creating the
> > > > > > following views:
> > > > > > user/register.html
> > > > > > user/create.html
> > > > > > default/user/register.html
> > > > > > default/user/create.html
> > > > > > auth/create.html
> > > > > > auth/register.html
>
> > > > > > None of them worked, how do you allow views for 
> > > > > > <domain>/default/user/
> > > > > > register ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to 
web2py+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to