import floof.lib.app_globals as app_globals
import floof.lib.helpers
+from floof import model
from floof.config.routing import make_map
-from floof.model import init_model
def load_environment(global_conf, app_conf):
"""Configure the Pylons environment via the ``pylons.config``
# Setup the SQLAlchemy database engine
engine = engine_from_config(config, 'sqlalchemy.')
- init_model(engine)
+
+ if model.elixir.options_defaults.get('autoload'):
+ model.elixir.bind = engine
+ model.metadata.bind = engine
+ model.elixir.setup_all()
+ else:
+ model.init_model(engine)
+
+ model.meta.engine = engine
# CONFIGURATION OPTIONS HERE (note: all config options will override
# any Pylons config options)