title: Problem querying from a model object
body: <p>I'm trying to use Pylons with SqlAlchemy (through Elixir).</p>
  
  <p>Here is my testdb/model/entities.py:</p>
  
  <pre><code>from elixir import *
  
  metadata.bind = "mysql://testdb:hundertwasser@localhost/testdb"
  metadata.bind.echo = True
  
  class Post(Entity):
      text = Field(Unicode(128))
  </code></pre>
  
  <p>And here is the controller:</p>
  
  <pre><code>import logging
  
  from pylons import request, response, session, tmpl_context as c, url
  from pylons.controllers.util import abort, redirect
  
  from testdb.lib.base import BaseController, render
  
  log = logging.getLogger(__name__)
  
  from testdb.model.entities import *
  
  class MainController(BaseController):
  
      def index(self):
          c.posts = Post.query.all()
          print "Test"
          return render('/index.mako')
  
      def submit(self):
          post = Post()
          post.text = request.POST.get['text']
          session.commit()
  </code></pre>
  
  <p>When I run the application, I get an error saying:</p>
  
  <pre><code>AttributeError: type object 'Post' has no attribute 'query'
  </code></pre>
  
  <p>Does someone know what I'm doing wrong? </p>