I'm writing an application in Pylons and I want to add an authorization scheme. I've chosen repoze.what. I followed the tutorial from Pylons cookbook:
http://wiki.pylonshq.com/display/pylonscookbook/Authorization+with+repoze.what
The problem is that in lib/auth.py
I need to include models for User, Group and Permission. Using declarative base in model, it gives me an error when I want to deploy:
sqlalchemy.exc.UnboundExecutionError: No engine is bound to this Table's MetaData.
Pass an engine to the Table via autoload_with=<someengine>, or associate the MetaData
with an engine via metadata.bind=<someengine>
I found similar problem here:
SQLAlchemy declarative syntax with autoload (reflection) in Pylons
I have all the models for authorization declared in a separate file from __init__.py
. I also followed all indications from above question but there is still something wrong.
Anyone found a solution?