I have a module that imports another that reads a db as follows:
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()
The imported module is as follows:
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
I keep getting this error:
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
--
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].
For more options, visit https://groups.google.com/d/optout.