Here is my current code:
def init_model(engine):
global t_user
t_user = sa.Table("User", meta.metadata,
sa.Column("id", sa.types.Integer, primary_key=True),
sa.Column("name", sa.types.String(100), nullable=False),
sa.Column("first_name", sa.types.String(100), nullable=False),
sa.Column("last_name", sa.types.String(100), nullable=False),
sa.Column("email", sa.types.String(100), nullable=False),
sa.Column("password", sa.types.String, nullable=False),
autoload=True,
autoload_with=engine
)
orm.mapper(User, t_user)
meta.Session.configure(bind=engine)
meta.Session = orm.scoped_session(sm)
meta.engine = engine
I then try to execute:
>>> meta.metadata.create_all(bind=meta.engine)
And receive the error:
raise exc.UnboundExecutionError(msg)
sqlalchemy.exc.UnboundExecutionError: The MetaData is not bound to an Engine or Connection. Execution can not proceed without a database to execute against. Either execute with an explicit connection or assign the MetaData's .bind to enable implicit execution.
In my development.ini I have:
# SQLAlchemy database URL
sqlalchemy.url = sqlite:///%(here)s/development.db
I'm new to Python's pylons and have no idea how to resolve this message. This is probably an easy fix to the trained eye. Thank you.