I am writing an application to service Dropbox webhooks and I have a controller class:
class webhook(http.Controller):
_cp_path="/pathto"
@http.request
def index(self, req, **kwargs):
"""Need to access database tables here"""
So I figured out that I need a cr, uid, and some other parameters,
I defined the following and have gotten it to work:
cr = openerp.sql_db.db_connect("DBNAME").cursor()
pool=openerp.pooler.RegistryManager.get("DBNAME")
result=pool.get("model.path").search(cr,1,[])
cr.close()
Is this the best way to do this?