title: Using repoze.what with declarative syntax in pylons
body: <p>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:</p>
  
  <p><a href="http://wiki.pylonshq.com/display/pylonscookbook/Authorization+with+repoze.what" rel="nofollow noreferrer">http://wiki.pylonshq.com/display/pylonscookbook/Authorization+with+repoze.what</a></p>
  
  <p>The problem is that in <code>lib/auth.py</code> 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:</p>
  
  <pre><code>sqlalchemy.exc.UnboundExecutionError: No engine is bound to this Table's MetaData.
  Pass an engine to the Table via autoload_with=&lt;someengine&gt;, or associate the MetaData
  with an engine via metadata.bind=&lt;someengine&gt;
  </code></pre>
  
  <p>I found similar problem here:</p>
  
  <p><a href="https://stackoverflow.com/questions/4526498/sqlalchemy-declarative-syntax-with-autoload-reflection-in-pylons">SQLAlchemy declarative syntax with autoload (reflection) in Pylons</a></p>
  
  <p>I have all the models for authorization declared in a separate file from <code>__init__.py</code>. I also followed all indications from above question but there is still something wrong.
  Anyone found a solution?</p>