Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pydal is not aware of ThreadSafeVariables #610

Open
carloshanson opened this issue Feb 21, 2020 · 0 comments
Open

pydal is not aware of ThreadSafeVariables #610

carloshanson opened this issue Feb 21, 2020 · 0 comments

Comments

@carloshanson
Copy link
Contributor

When using _enable_record_versioning() or table inheritance, an AttributeError is thrown. In either case the traceback is the same from pydal/base.py, line 656. The following is for table inheritance:

monster = db.Table(db, 'monster', Field('color'), Field('size'))
db.define_table('thing', Field('name'), monster)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/chanson/py/py4web/apps/thing/__init__.py", line 7, in <module>
    from . models import db
  File "/home/chanson/py/py4web/apps/thing/models.py", line 9, in <module>
    db.define_table('thing', Field('name'), monster)
  File "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py", line 656, in define_table
    table = self.lazy_define_table(tablename, *fields, **kwargs)
  File "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/site-packages/pydal/base.py", line 676, in lazy_define_table
    if field.requires is DEFAULT:
  File "/home/chanson/.local/share/virtualenvs/py4web-recc_4-8/lib/python3.6/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 '139976984026752.139976984930736'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant