Subversion Repositories SmartDukaan

Rev

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

Rev 9665 Rev 10050
Line 196... Line 196...
196
    lastUpdatedOnSnapdeal = Field(DateTime)
196
    lastUpdatedOnSnapdeal = Field(DateTime)
197
    pendingOrders = Field(Integer)
197
    pendingOrders = Field(Integer)
198
    using_options(shortnames=True)
198
    using_options(shortnames=True)
199
    using_table_options(mysql_engine="InnoDB")
199
    using_table_options(mysql_engine="InnoDB")
200
    
200
    
-
 
201
class FlipkartInventorySnapshot(Entity):
-
 
202
    item_id = Field(Integer, primary_key=True,autoincrement=False)
-
 
203
    availability = Field(Integer)
-
 
204
    createdOrders = Field(Integer)
-
 
205
    heldOrders = Field(Integer)
-
 
206
    using_options(shortnames=True)
-
 
207
    using_table_options(mysql_engine="InnoDB")
-
 
208
        
-
 
209
    
201
def initialize(dbname='inventory', db_hostname="localhost"):
210
def initialize(dbname='inventory', db_hostname="localhost"):
202
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
211
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
203
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
212
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
204
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
213
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
205
    metadata.bind = iengine
214
    metadata.bind = iengine