Subversion Repositories SmartDukaan

Rev

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

Rev 6821 Rev 7281
Line 164... Line 164...
164
    is_oos = Field(Boolean)
164
    is_oos = Field(Boolean)
165
    num_orders = Field(Integer)
165
    num_orders = Field(Integer)
166
    using_options(shortnames=True)
166
    using_options(shortnames=True)
167
    using_table_options(mysql_engine="InnoDB")
167
    using_table_options(mysql_engine="InnoDB")
168
    
168
    
-
 
169
class AmazonInventorySnapshot(Entity):
-
 
170
    item_id = Field(Integer, primary_key=True)
-
 
171
    availability = Field(Integer)
-
 
172
    reserved = Field(Integer)
-
 
173
    using_options(shortnames=True)
-
 
174
    using_table_options(mysql_engine="InnoDB")
-
 
175
    
169
def initialize(dbname='inventory', db_hostname="localhost"):
176
def initialize(dbname='inventory', db_hostname="localhost"):
170
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
177
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
171
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
178
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
172
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
179
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
173
    metadata.bind = iengine
180
    metadata.bind = iengine