I’m trying to put an image in view section I have defined a table but it seems{{for table in tables:}} doesn’t work. My code is:
default.py (Controller)
def index():
return dict(message=T('Hello World'))
def Tables():
return dict(tables=db().select(db.table.ALL))
def download():
return response.download(request, db)
db.py (model)
db.define_table('table',
Field('image', type='upload')
This is it and I tried to do {{for table in tables:}} before putting the image, but it says, the tables is not defined.I used {{pass}} after for. Can you guys help me a bit?
Cheers
Are you trying to edit which view?
from your code it will work well:
in model
in dontrollers/default.py
in views/default/tables.html