Hi, I'm testing py4web and I'm stuck with record versioning.
If in models.py I define a trivial table with versioning enabled like this:
### Define you table below
#
# db.define_table('thing', Field('name'))
#
## always commit your models to avoid problems later
#
# db.commit()
#
db.define_table('thing', Field('name'))
db.thing._enable_record_versioning()
db.commit()
I get this error:
FAILED] loading biolab
Traceback (most recent call last):
File
"/opt/anaconda/envs/py4web_biolab/lib/python3.7/site-packages/py4web/core.py",
line 668, in import_apps
module_name, init).load_module()
File "<frozen importlib._bootstrap_external>", line 407, in
_check_name_wrapper
File "<frozen importlib._bootstrap_external>", line 907, in load_module
File "<frozen importlib._bootstrap_external>", line 732, in load_module
File "<frozen importlib._bootstrap>", line 265, in _load_module_shim
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in
_call_with_frames_removed
File "/home/anaconda/apps/biolab/__init__.py", line 6, in <module>
from . models import db
File "/home/anaconda/apps/biolab/models.py", line 21, in <module>
db.thing._enable_record_versioning()
File
"/opt/anaconda/envs/py4web_biolab/lib/python3.7/site-packages/pydal/objects.py",
line 436, in _enable_record_versioning
*clones, **d)
File
"/opt/anaconda/envs/py4web_biolab/lib/python3.7/site-packages/pydal/base.py",
line 592, in define_table
table = self.lazy_define_table(tablename, *fields, **kwargs)
File
"/opt/anaconda/envs/py4web_biolab/lib/python3.7/site-packages/pydal/base.py",
line 610, in lazy_define_table
if field.requires is DEFAULT:
File
"/opt/anaconda/envs/py4web_biolab/lib/python3.7/site-packages/threadsafevariable/__init__.py",
line 16, in __get__
return getattr(self.storage, "%s.%s" % (id(instance), id(self)))
File "src/gevent/local.py", line 408, in
gevent._local.local.__getattribute__
AttributeError: 'gevent._local.local' object has no attribute
'140473993792312.140473994751056'
I tried to follow pydal source to find the cause, the odd thing is that the
creation of "thing" table seems to go well, but its archive definition
apparently clashes with threadsafe variables (or their lack).
What am I missing?
--
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/476da232-b494-4c5d-bc7d-a6f0a69eb10e%40googlegroups.com.