sorry it was renamed

gluon.tools

On Jan 24, 10:51 am, Yannick <[email protected]> wrote:
> Thanks for the note...
> I try this example  and I have the following error message:
> "
>   Traceback (most recent call last):
>   File "/opt/web2py/gluon/restricted.py", line 62, in restricted
>     exec ccode in environment
>   File "/opt/web2py/applications/myapp/models/db.py", line 13, in
> <module>
>     from gluon.utils import *
>     ImportError: No module named utils
> "
>
> Did you change the module Utils to something else ? I'm using the
> latest version Web2Py Version 1.55.2
>
> Thanks.
>
> On Jan 20, 6:36 pm, mdipierro <[email protected]> wrote:
>
> > I have a preliminary version of inclusion if T2 functionality into
> > web2py core. I am not yet promising backward compatibility here. The
> > module name many change. For now it is in trunk as gluon/utils.py
>
> > Here is how you use it (assuming [app] is you application name).
>
> > 1) put this in your model
>
> > from gluon.utils import *
> > auth=Auth(globals(),db)
> > auth.define_tables()
> > crud=Crud(globals(),db)
>
> > 2) put this in your "default" controller
>
> > def user(): return dict(form=auth())
> > def database(): return dict(form=crud())
> > def download(): return response.download()
>
> > def index():
> >     response.flash=T('Welcome to web2py')
> >     return dict(message=T('Hello World'))
>
> > Now 
> > visit:http://..../[app]/default/user/registerhttp://..../[app]/default/user/loginhttp://..../[app]/default/user/profilehttp://..../[app]/default/user/change_passwordhttp://..../[app]/default/user/groupshttp://..../[app]/default/user/logouthttp://..../[app]/default/user/retrieve_password
>
> >http://..../[app]/default/database/tableshttp://..../[app]/default/database/select/[app]_eventhttp://..../[app]/default/database/create/[app]_eventhttp://..../[app]/default/database/read/[app]_event/1http://..../[app]/default/database/update/[app]_event/1http://..../[app]/default/database/delete/[app]_event/1
>
> > now add to the model
>
> > mail=Mail()
> > mail.settings.server='smtp.whetever.com'
> > mail.settings.sender='[email protected]'
> > mail.settings.longin='username:password'
> > auth.settings.mail=mail
>
> > so that registration requires email verification
>
> > then add
>
> > auth.settings.captcha=RECAPTCHA
> > (request,public_key='RECAPTCHA_PUBLIC_KEY',private_key='RECAPTCHA_PRIVATE_KEY')
>
> > so that registration will use recaptcha
>
> > then add
>
> > crud.auth=auth
>
> > so that crud will enforce role based access control....
>
> > now you lost the permission to accesshttp://.../database/....
>
> > now give yourself back permission *only* to select record in table
> > [app]_user
>
> > group_id=auth.add_group(role='Manager')
> > auth.add_membership(group_id,auth.user.id)
> > auth.add_permission(group_id,'select','[app]_user')
>
> > or to delete users
>
> > auth.add_permission(group_id,'delete','[app]_user')
>
> > get the idea?.... I think I have been following (or tried to) the
> > advice of some of the members here like Yarko, Ceej, Bill, Fran, and
> > others.
>
> > There is a lot more stuff in there (like decorators that enforce
> > permissions) that needs polishing and documenting.
>
> > Volunteers to help?
>
> > Massimo
--~--~---------~--~----~------------~-------~--~----~
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