> return dict(records=db().select(db.tablename.ALL))

You can´t use the word tablename if you don´t have a table named tablename. If you wan´t to have everything from a table named customers use
return dict(records=db().select(db.customers.ALL))


Kenneth

it throws below error

Traceback (most recent call last):
   File "/home/sushanth/Desktop/web2py/gluon/restricted.py", line 188,
in restricted
     exec ccode in environment
   File "/home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py", line 104, in<module>
   File "/home/sushanth/Desktop/web2py/gluon/globals.py", line 96, in
<lambda>
     self._caller = lambda f: f()
   File "/home/sushanth/Desktop/web2py/applications/welcome/controllers/
default.py", line 66, in contacts
     return dict(records=db().select(db.gtmaster.ALL))
   File "/home/sushanth/Desktop/web2py/gluon/sql.py", line 1400, in
__getattr__
     return dict.__getitem__(self,key)
KeyError: 'tablename'

On Dec 16, 11:47 pm, pbreit<[email protected]>  wrote:
Here's one:https://groups.google.com/d/topic/web2py/mH5Toup0vwk/discussion

Reply via email to