Changeset 865 for trunk/core/promogest/Environment.py
- Timestamp:
- 03/09/10 12:53:27 (6 months ago)
- Files:
-
- 1 modified
-
trunk/core/promogest/Environment.py (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/core/promogest/Environment.py
r843 r865 374 374 375 375 376 376 377 class SetTextFactory(PoolListener): 377 378 def connect(self, dbapi_con, con_record): … … 395 396 encoding='utf-8', 396 397 convert_unicode=True ) 398 399 if hasattr(conf,'Database2'): 400 print "HO LA CONFIGURAZIONE PER IL SECONDO DATABASE" 401 # try: 402 database2 = conf.Database2.database2 403 port2 = conf.Database2.port2 404 user2 = conf.Database2.user2 405 password2 = conf.Database2.password2 406 host2 = conf.Database2.host2 407 engine2 = create_engine('postgres:'+'//' 408 +user2+':' 409 + password2+ '@' 410 + host2 + ':' 411 + port2 + '/' 412 + database2, 413 encoding='utf-8', 414 convert_unicode=True ) 415 engine2.echo = False 416 Session2 = scoped_session(sessionmaker(bind=engine, autoflush=True)) 417 session2 = Session2() 418 meta2 = MetaData(engine2) 419 print "IL SECONDO DB E' A POSTO" 420 # except: 421 # print "MESSO IN UN TRY IL SECONDO DB" 422 397 423 tipo_eng = engine.name 398 424 engine.echo = False 399 425 meta = MetaData(engine) 400 #Session = sessionmaker(bind=engine)426 #Session = sessionmaker(bind=engine) 401 427 Session = scoped_session(sessionmaker(bind=engine, autoflush=True)) 402 428
