Subversion Repositories SmartDukaan

Rev

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

Rev 12363 Rev 17769
Line 238... Line 238...
238
    grnDetail = Field(Text)
238
    grnDetail = Field(Text)
239
    stockQuantity = Field(Integer)
239
    stockQuantity = Field(Integer)
240
    avgWeightedNlc = Field(Float)
240
    avgWeightedNlc = Field(Float)
241
    using_options(shortnames=True)
241
    using_options(shortnames=True)
242
    using_table_options(mysql_engine="InnoDB")    
242
    using_table_options(mysql_engine="InnoDB")    
243
def initialize(dbname='inventory', db_hostname="localhost"):
243
def initialize(dbname='inventory', db_hostname="localhost", setup=True):
244
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
244
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
245
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
245
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
246
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
246
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
247
    metadata.bind = iengine
247
    metadata.bind = iengine
248
    metadata.bind.echo = True
248
    metadata.bind.echo = True
249
    setup_all(True)
249
    setup_all(setup)
250
 
250
 
251
if __name__=="__main__":
251
if __name__=="__main__":
252
    initialize()
252
    initialize()
253
253