At the lowest approximation you just need

from gluon.tools import *
auth=Auth(globals(),db) ### (1)
crud=Crud(globals(),db) ### (2)

in model and

def user(): return dict(form=auth()) ### (1)
def data(): return dict(form=crud()) ### (2)
def download(): return response.download(request,db)

1) exposes all the authentication stuff.
2) exposes crud for all your tables (it can be restricted)

read more here: http://mdp.cti.depaul.edu/examples/default/tools


On Feb 13, 4:45 am, annet <[email protected]> wrote:
> I went through the web2py manual and the Web Design Patterns and T2
> Components PDF. I am happy with the way web2py is being developed,
> however, since I am a novice when it comes to Python an web2py, the
> implications of the iterations are not always clear to me.
>
> Am I right to conclude that Python is T0 web2py is T1, that on top of
> web2py you got T2 and T3 and that from web2py version 1.56 the
> authentication, authorization and crud functionality is moved from the
> T2 into tools.py?
>
> I downloaded web2py 1.56.2 and had a look at the db.py file, as far as
> I can judge using tools.py would considerably increase my
> productivity, however, I haven't got a clue where to start. Is it a
> matter of uncommenting the code and moving
>
> def user(): return dict(form=auth())
> def data(): return dict(form=crud())
> def download(): return response.download(request,db)
>
> to the default.py controller?
>
> Do I have to change anything in
>
> http://..../[app]/default/user/login
>
> or are the gaps filled programmatically?
>
> I hope tools.py will be well documented very soon, and that a tutorial
> will be made available. At the moment I am googling the workgroup for
> answers to my questions, but this results in a puzzle like thing with
> lots of pieces missing, which is rather awkward.
>
> Best regards,
>
> Annet.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"web2py Web Framework" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to