Hello,
I have a problem:
#@auth.requires_login()
def new_acc():
if auth.user_id == None:
new_acc="You need to authorize"
else:
try:
TestDB.define_table(auth.user.username, Field('trv_username',
readable=True, writable=True), Field('trv_password', readable=True, writable
=True))
new_acc="Base created"
except:
new_acc = SQLFORM('TestDB.%s' % auth.user.username) # There's a
problem
if new_acc.accepts(request):
TestDB.testuser.insert(trv_username=request.vars.
trv_username,trv_password=request.vars.trv_password)
return dict(form=new_acc)
When user logges in and visiting new_acc.html, it creates table with name
of his 'username' (Example: username = 'foo', so table will be TestDB.foo).
When user goes on this url again I want him to get the SQLFORM(TestDB.
username), where username should be a variable.
Can anyone help me with solution of this problem? I'm learning python about
half a year, and about 3 days working with web2py.
Thank you.
--
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/d/optout.