While I download...
Are the download files signed and/or hashed? just in case...
mic
2011/9/20 Massimo Di Pierro <massimo....@gmail.com>:
Traceback (most recent call last):
File "/etc/web2py/gluon/restricted.py", line 194, in restricted
exec ccode in environment
File "/etc/web2py/applications/alt_login/models/db.py", line 56, in <module>
IS_NOT_EMPTY(error_message=auth.messages.is_empty)
NameError: name 'auth_table' is not defined
I wanted to play with other login methods. Therefore I created a new application called "alt_login" - it started with no problems.
Next step: I copied the definition of my own "auth_table" from the book into alt_login.
Here are the lines of code:
db.define_table(
auth.settings.table_user_name,
Field('first_name', length=128, default=''),
Field('last_name', length=128, default=''),
Field('email', length=128, default='', unique=True),
Field('password', 'password', length=512,
readable=False, label='Password'),
Field('registration_key', length=512,
writable=False, readable=False, default=''),
Field('reset_password_key', length=512,
writable=False, readable=False, default=''),
Field('registration_id', length=512,
writable=False, readable=False, default=''))
custom_auth_table = db[auth.settings.table_user_name] # get the custom_auth_table
custom_auth_table.first_name.requires = \
IS_NOT_EMPTY(error_message=auth.messages.is_empty)
custom_auth_table.last_name.requires = \
IS_NOT_EMPTY(error_message=auth.messages.is_empty)
custom_auth_table.password.requires = [IS_STRONG(), CRYPT()]
custom_auth_table.email.requires = [
IS_EMAIL(error_message=auth.messages.invalid_email),
IS_NOT_IN_DB(db, custom_auth_table.email)]
auth.settings.table_user = custom_auth_table # tell auth to use custom_auth_table
# before
# auth.define_tables()
custom_auth_table = db[auth.settings.table_user_name] # get the custom_auth_table
Yes. There are different versions depending on the accept_language
That is the headline of the first page:The Official (3rd Ed.)
web2py Book(de)Does "de" mean "German"? But there is no German word inside this book.And I cann't find any way to change the language.
Please download the nightly built and try it with your apps. If they
work, say go and I we will launch tomorrow.
Traceback (most recent call last):
File "/home/rochacbruno/projects/199test/gluon/restricted.py", line 194, in restricted
exec ccode in environment
File "/home/rochacbruno/projects/199test/applications/rifaapp/controllers/default.py", line 755, in <module>
File "/home/rochacbruno/projects/199test/gluon/globals.py", line 148, in <lambda>
self._caller = lambda f: f()
File "/home/rochacbruno/projects/199test/applications/rifaapp/controllers/default.py", line 618, in user
return dict(form=auth())
File "/home/rochacbruno/projects/199test/gluon/tools.py", line 1125, in __call__
return getattr(self,args[0])()
File "/home/rochacbruno/projects/199test/gluon/tools.py", line 1868, in register
next = replace_id(next, form)
File "/home/rochacbruno/projects/199test/gluon/tools.py", line 74, in replace_id
if url and not url[0] == '/' and url[:4] != 'http':
File "/home/rochacbruno/projects/199test/applications/cursodepython/controllers/default.py", line 272, in user
return dict(form=auth())
File "/home/rochacbruno/projects/199test/gluon/tools.py", line 1125, in __call__
return getattr(self,args[0
])()
File "/home/rochacbruno/projects/199test/gluon/tools.py", line 1724, in login
Some weeks ago, I reported here some typo related with validators. Someone tell me that the typo has been corrected, but when I check again the book, the typo still there.
This is what I got. No fix, for now.
Say you have a datetime field. The database adapter will save it as a
TIMESTAMP sqlite type.
Now if you decide you just want the date, you don't care for the time.
You change the field to be a date col. But SQLite still use the
TIMESTAMP field type. At this point, it converts timestamp to date, as
part of what the python sqlite adapter tells it to do, and that line
has a bug, that creates the ValueError.
I have no idea how 1.98.2 can go around this. It seems more an sqlite
bug, then a web2py bug. Yet - the problem remains.
Hope someone will have a better idea what's going on here.