projects
/
zzz-floof.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added myself to websetup.
[zzz-floof.git]
/
floof
/
config
/
environment.py
diff --git
a/floof/config/environment.py
b/floof/config/environment.py
index
1ee51b8
..
20683db
100644
(file)
--- a/
floof/config/environment.py
+++ b/
floof/config/environment.py
@@
-8,8
+8,8
@@
from sqlalchemy import engine_from_config
import floof.lib.app_globals as app_globals
import floof.lib.helpers
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.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``
def load_environment(global_conf, app_conf):
"""Configure the Pylons environment via the ``pylons.config``
@@
-39,7
+39,15
@@
def load_environment(global_conf, app_conf):
# Setup the SQLAlchemy database engine
engine = engine_from_config(config, 'sqlalchemy.')
# 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)
# CONFIGURATION OPTIONS HERE (note: all config options will override
# any Pylons config options)