web2py™ Version 2.18.5-stable
tryin to use T() in modules
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, in
restricted
exec(ccode, environment)
File
"/Users/sugizo/learn/python/web2py/applications/test/controllers/api.py",
line 4, in <module>
import test_db
File "/Users/sugizo/learn/python/web2py/gluon/custom_import.py", line 74,
in custom_importer
modules_prefix, globals, locals, (itemname,), level)
File
"/Users/sugizo/learn/python/web2py/applications/test/modules/test_db.py",
line 59, in <module>
format = lambda r: \
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/base.py",
line 592, in define_table
table = self.lazy_define_table(tablename, *fields, **kwargs)
File "/Users/sugizo/learn/python/web2py/gluon/packages/dal/pydal/base.py",
line 633, in lazy_define_table
on_define(table)
File
"/Users/sugizo/learn/python/web2py/applications/test/modules/test_db.py",
line 36, in on_define_address
table.zip_code.requires = IS_EMPTY_OR(IS_MATCH('^\d{5,5}$',
error_message = T('not a Zip Code') ) )
NameError: name 'T' is not defined
tryin to import languages but still got an error
from gluon.languages import *
Traceback (most recent call last):
File "/Users/sugizo/learn/python/web2py/gluon/restricted.py", line 219, in
restricted
exec(ccode, environment)
File
"/Users/sugizo/learn/python/web2py/applications/test/controllers/api.py",
line 4, in <module>
import test_db
File "/Users/sugizo/learn/python/web2py/gluon/custom_import.py", line 74,
in custom_importer
modules_prefix, globals, locals, (itemname,), level)
File
"/Users/sugizo/learn/python/web2py/applications/test/modules/test_db.py",
line 7, in <module>
from gluon.languages import *
AttributeError: module 'gluon.languages' has no attribute 'translator'
any hints ?
thx n best regards,
stifan
--
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].
To view this discussion on the web visit
https://groups.google.com/d/msgid/web2py/a045c6fd-cb90-4016-bb0d-81812f4efbf9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.