Show
Ignore:
Timestamp:
03/09/10 12:53:27 (6 months ago)
Author:
francesco
Message:

aggiunte funzionalità all'inventario

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/core/promogest/Environment.py

    r843 r865  
    374374 
    375375 
     376 
    376377class SetTextFactory(PoolListener): 
    377378     def connect(self, dbapi_con, con_record): 
     
    395396                    encoding='utf-8', 
    396397                    convert_unicode=True ) 
     398 
     399if 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 
    397423tipo_eng = engine.name 
    398424engine.echo = False 
    399425meta = MetaData(engine) 
    400     #Session = sessionmaker(bind=engine) 
     426#Session = sessionmaker(bind=engine) 
    401427Session = scoped_session(sessionmaker(bind=engine, autoflush=True)) 
    402428