from gluon import current
from pydal import DAL, Field
from unidecode import unidecode
from applications.Hestque_Wellness.modules.Hestquewell.q_refs import definition
db = DAL('sqlite://storage.sqlite')
current.db = db
define = definition()
from gluon import current
from pydal import DAL, Field
db = DAL('sqlite://storage.sqlite')
current.db = db
def reference():
db = current.db
db.define_table('definition', Field('definition'), migrate=False)
rows = db(db.definition).select()
for row in rows:
return row.definition
definition = definition()
File "applications/Hestque_Wellness/modules/Hestquewell/q_refs.py", line 321, in definition
db.define_table('definition', Field('definition'), migrate=False)
File "/usr/local/lib/python2.7/dist-packages/pydal/base.py", line 571, in define_table
raise SyntaxError('table already defined: %s' % tablename)
SyntaxError: table already defined: definition
what could be the problem?
Kind regards
define = definition(db)
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/7xCGTfc6xAA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Can't help without the code.
File "applications/Hestque_Wellness/modules/Hestquewell/abnvalinterpretation/wellabnvalinterpret0.py", line 101, in wellabnvalinterpret
rows = db(db.health).select()
File "/usr/local/lib/python2.7/dist-packages/pydal/objects.py", line 2250, in select
return adapter.select(self.query, fields, attributes)
File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/sqlite.py", line 82, in select
return super(SQLite, self).select(query, fields, attributes)
File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/base.py", line 762, in select
return self._select_aux(sql, fields, attributes, colnames)
File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/base.py", line 718, in _select_aux
rows = self._select_aux_execute(sql)
File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/base.py", line 712, in _select_aux_execute
self.execute(sql)
File "/usr/local/lib/python2.7/dist-packages/pydal/adapters/__init__.py", line 63, in wrap
if not args[0].connection:
File "/usr/local/lib/python2.7/dist-packages/pydal/connection.py", line 36, in connection
return getattr(THREAD_LOCAL, self._connection_uname_)
AttributeError: 'thread._local' object has no attribute '_pydal_connection_140327873342608_17719'
Will send it once I get back to the comp
On Sun, 22 Apr 2018, 20:55 Anthony <abas...@gmail.com> wrote:
Can't help without the code.
--
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 a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/7xCGTfc6xAA/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
module:#define codefrom gluon import currentfrom pydal import DAL, Fielddb = current.db
def definition():rows = db(db.definition).select()for row in rows:return row.definition
I solved the thread.local error by declaring the rows=db(db.health).select() as a global object in my code.