I moved some of my code from controller to my modules but now am getting
this error:
if db(db.post).isempty():
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 'post'
This is the code:
model:
db.define_table('post',
Field('author', 'reference auth_user', default=auth.user_id,
writable=False, readable=False),
controller:
if db(db.post).isempty():
db.post.insert(message="Hi, it's" +' ' +auth.user.first_name+' '+
'loging
in...')
form = SQLFORM(db.post, formstyle='table3cols',)
Where could I be wrong on this?
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.