title: SQLAlchemy bug? I'm not sure
body: <pre><code>from sqlalchemy import create_engine
  from sqlalchemy import Table, Column, Integer, String, MetaData, ForeignKey
  from sqlalchemy.orm import mapper, sessionmaker
  from sqlalchemy.ext.declarative import declarative_base
  
  from bottle import route, post, get, request
  import os
  
  Base = declarative_base()
  
  class User(Base):
      """Table for login details"""
      __tablename__ = 'login_table'
      id = Column(Integer, primary_key=True)
      username =  Column(String)
      password =  Column(String)
      email = Column(String)
  
      def __init__(self, username, password, email):
          """Create a object containing info of a user"""
          self.username = username
          self.password = password
          self.email = email
  
      def __str__(self):
          """Return a string representation"""
          return self.username
  
      def __repr__(self):
          """Return a object representation"""
          return "&lt;User(%s)&gt;" % self.username
  
  def force_engine():
      engine = create_engine('sqlite:///users.db', echo=True)
      Base.metadata.create_all(engine)
      Session = sessionmaker()
      Session.configure(bind=engine)
      session = Session()
      session.commit()
  
  def spawn_session():
      engine = create_engine('sqlite:///users.db')
      Session = sessionmaker()
      Session.configure(bind=engine)
      return Session()
  
  def create_user(username, password, email):
      session = spawn_session()
      session.add(User(username, password, email))
      session.commit()
      return True
  
  def register_test():
      create_user('dave','test', 'a')
      create_user('cat','123','a')
  
  if not os.path.exists('users.db'):
      force_engine()
  
  @get('/register')
  def register_form():
      return '''&lt;form method="POST"&gt;
                  &lt;p&gt;Welcome new user. Enter a username, password, email.&lt;/p&gt;&lt;/br&gt;
                  &lt;p&gt;Username: &lt;/p&gt;&lt;input name="username" type="text" /&gt;&lt;/br&gt;
                  &lt;p&gt;Password: &lt;/p&gt;&lt;input name="password" type="password" /&gt;&lt;/br&gt;
                  &lt;p&gt;Email: &lt;/p&gt;&lt;input name="email" type="text" /&gt;&lt;/br&gt;
                  &lt;input type="submit" value="Submit" /&gt;
                &lt;/from&gt;'''
  
  @post('/register')
  def register_submit():
      name     = request.forms.get('username')
      password = request.forms.get('password')
      email = request.forms.get('email')
      authd = create_user(name, password, email)
      if authd:
          return "&lt;p&gt;User created&lt;/p&gt;"
      else:
          return "&lt;p&gt;Failure&lt;/p&gt;"
  </code></pre>
  
  <p>This is the code I'm using. Don't tell me about security, or anything else. Just help me figure out why its causing this traceback</p>
  
  <pre><code>&gt;&gt;&gt; register_test()
  Traceback (most recent call last):
    File "&lt;interactive input&gt;", line 1, in &lt;module&gt;
    File "C:\Users\Public\Documents\webapps\login\register.py", line 54, in register_test
      create_user('dave','test', 'a')
    File "C:\Users\Public\Documents\webapps\login\register.py", line 50, in create_user
      session.commit()
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\session.py", line 623, in commit
      self.transaction.commit()
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\session.py", line 385, in commit
      self._prepare_impl()
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\session.py", line 369, in _prepare_impl
      self.session.flush()
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\session.py", line 1397, in flush
      self._flush(objects)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\session.py", line 1478, in _flush
      flush_context.execute()
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\unitofwork.py", line 304, in execute
      rec.execute(self)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\unitofwork.py", line 448, in execute
      uow
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\orm\mapper.py", line 1872, in _save_obj
      execute(statement, params)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\engine\base.py", line 1191, in execute
      params)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\engine\base.py", line 1271, in _execute_clauseelement
      return self.__execute_context(context)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\engine\base.py", line 1302, in __execute_context
      context.parameters[0], context=context)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\engine\base.py", line 1401, in _cursor_execute
      context)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\engine\base.py", line 1394, in _cursor_execute
      context)
    File "C:\Python26\lib\site-packages\sqlalchemy-0.6.5-py2.6.egg\sqlalchemy\engine\default.py", line 299, in do_execute
      cursor.execute(statement, parameters)
  OperationalError: (OperationalError) table login_table has no column named email u'INSERT INTO login_table (username, password, email) VALUES (?, ?, ?)' ('dave', 'test', 'a')
  </code></pre>
  
  <p>Even when I close down python entirely, and delete the database entirely I still get the same execption</p>