Hi *:
I'm trying to implement an essential version of a plugin_openlayers
starting from the job made by Massimo with plugin_gmap but I don't
understand how the db set is passed from a controller to the plugin_*
controller, well even if it seams clear setting the data set in a
storage defined in a model seams not to work and I obtains:
File
"/home/manuele/Dropbox/sviluppo/web2py-1.96.4/applications/wind2pow2/controllers/plugin_openlayers.py",
line 8, in index
rows = plugin_openlayers.set.select()
AttributeError: 'NoneType' object has no attribute 'select'
so it seams that when I fix the new value in the plugin_openlayers
storage in my controller function it does not change the value in the
storage defined in model.
I hope to be clear
can you help me please?
I leave you here under some example code...
models/plugin_openlayers.py
from gluon.storage import Storage
plugin_openlayers=Storage()
------------------------------------------------
controllers/plugin_openlayers.py
def index():
width = request.vars.width or 400
height = request.vars.height or 300
rows = plugin_openlayers.set.select()
return dict(width=width, height=height, rows=rows)
------------------------------------------------
controllers/default.py
def index():
site_id = request.vars.item_id
plugin_openlayers.set = db(db.site.id==site_id)
return dict()
------------------------------------------------
thank you very much
Manuele