Subversion Repositories SmartDukaan

Rev

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

Rev 6531 Rev 6532
Line 151... Line 151...
151
    using_table_options(mysql_engine="InnoDB")
151
    using_table_options(mysql_engine="InnoDB")
152
 
152
 
153
def initialize(dbname='inventory', db_hostname="localhost"):
153
def initialize(dbname='inventory', db_hostname="localhost"):
154
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
154
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
155
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
155
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
156
    engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
156
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
157
    metadata.bind = engine
157
    metadata.bind = iengine
158
    metadata.bind.echo = True
158
    metadata.bind.echo = True
159
    setup_all(True)
159
    setup_all(True)
160
 
160
 
161
if __name__=="__main__":
161
if __name__=="__main__":
162
    initialize()
162
    initialize()
163
163