0
|
1 """The application's model objects"""
|
|
2 import logging
|
|
3 from pylons_app.model import meta
|
|
4 log = logging.getLogger(__name__)
|
|
5
|
|
6 def init_model(engine):
|
|
7 """Call me before using any of the tables or classes in the model"""
|
|
8 log.info("INITIALIZING DB MODELS")
|
|
9 meta.Base.metadata.bind = engine
|
|
10 #meta.Base2.metadata.bind = engine2
|
|
11
|
|
12 #THIS IS A TEST FOR EXECUTING SCRIPT AND LOAD PYLONS APPLICATION GLOBALS
|
|
13 #from paste.deploy import appconfig
|
|
14 #from pylons import config
|
|
15 #from sqlalchemy import engine_from_config
|
|
16 #from pylons_app.config.environment import load_environment
|
|
17 #
|
|
18 #conf = appconfig('config:development.ini', relative_to = './../../')
|
|
19 #load_environment(conf.global_conf, conf.local_conf)
|
|
20 #
|
|
21 #engine = engine_from_config(config, 'sqlalchemy.')
|
|
22 #init_model(engine)
|
|
23 # DO SOMETHING
|