Subversion Repositories SmartDukaan

Rev

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

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