Subversion Repositories SmartDukaan

Rev

Rev 24212 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 24212 Rev 35608
Line 16... Line 16...
16
 
16
 
17
#===============================================================================
17
#===============================================================================
18
# Different entities in the model
18
# Different entities in the model
19
#===============================================================================
19
#===============================================================================
20
 
20
 
21
def initialize(dbname='transaction', db_hostname="localhost", echoOn=True, setup=True):
21
def initialize(dbname='transaction', db_hostname="localhost", echoOn=False, setup=True):
22
    #metadata.bind = "sqlite:///Transactionsnew.sqlite"
22
    #metadata.bind = "sqlite:///Transactionsnew.sqlite"
23
    #metadata.bind = 'mysql://root:shop2020@localhost/transaction'
23
    #metadata.bind = 'mysql://root:shop2020@localhost/transaction'
24
    engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
24
    engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname,
-
 
25
                           pool_recycle=3600, pool_timeout=30, pool_pre_ping=True)
25
    metadata.bind = engine
26
    metadata.bind = engine
26
    metadata.bind.echo = echoOn
27
    metadata.bind.echo = echoOn
27
    setup_all(setup)
28
    setup_all(setup)
28
 
29
 
29
 
30