Ok, no problem.
Obs.: perfil <=> profile, autenticacao <=> authentication
On db.py I have this login settings:
## login settings
auth.settings.login_url = URL('autenticacao', 'index')
auth.settings.logout_next = URL('autenticacao', 'index')
auth.settings.logged_url = URL('default', 'perfil')
---------------
On index function from the controller autenticacao I have this code:
def index():
return dict(form_login=auth.login())
---------------
On index, and perfil functions from the controller default I have this:
def index():
return dict()
@auth.requires_login()
def perfil():
usuario = db(db.auth_user.id==auth.user_id).select()[0]
usuario.nome_completo = ' '.join([usuario.first_name,
usuario.last_name])
fazendas = db(db.fazendas.usuario==auth.user_id).select()
return dict(
nome_completo=usuario.nome_completo.strip(),
email=usuario.email.strip(),
rg=usuario.rg.strip(),
cpf=usuario.cpf.strip(),
data_nascimento=usuario.dataNascimento.strip(),
fazendas=fazendas
)
--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
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.