AttributeError: 'DAL' object has no attribute 'definitions'

43 views
Skip to first unread message

Maurice Waka

unread,
Sep 2, 2018, 1:16:08 PM9/2/18
to web2py-users
rows = db(db.definitions.definitions).select()
 
File "/usr/local/lib/python2.7/dist-packages/pydal/base.py", line 669, in __getattr__
 
return BasicStorage.__getattribute__(self, key)
AttributeError: 'DAL' object has no attribute 'definitions'
I am getting the above error with my code.
I am using a function in the models that imports several functions like this below:
def definitions(): db = current.db rows = db(db.definitions.definitions).select() for row in rows: return row.definitions

The model code is this:
db = DAL('sqlite://storage.sqlite', pool_size=1000000, folder=None, db_codec='UTF-8', check_reserved=None, migrate=False, fake_migrate=False,))
db
.define_table('definitions', Field('definitions', 'text', length= 1000000, default="", notnull=True))



What could be wrong with my code? and how do I correct it.
Regards

Lovedie JC

unread,
Sep 3, 2018, 3:24:44 AM9/3/18
to web...@googlegroups.com
Had to clean up cache, restart web2py. It's OK now. 

--
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 web2py+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Maurice Waka

unread,
Sep 3, 2018, 6:20:11 AM9/3/18
to web...@googlegroups.com
Thanks for the response.
Great! 

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/fVTULlaSNzQ/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+un...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages