Subversion Repositories SmartDukaan

Rev

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

Rev 6751 Rev 6821
Line 149... Line 149...
149
    sellingPrice = Field(Float) 
149
    sellingPrice = Field(Float) 
150
    totalAvailability = Field(Integer)
150
    totalAvailability = Field(Integer)
151
    using_options(shortnames=True)
151
    using_options(shortnames=True)
152
    using_table_options(mysql_engine="InnoDB")
152
    using_table_options(mysql_engine="InnoDB")
153
 
153
 
-
 
154
class ItemStockPurchaseParams(Entity):
-
 
155
    item_id = Field(Integer, primary_key=True, autoincrement=False)
-
 
156
    numOfDaysStock = Field(Integer)
-
 
157
    minStockLevel = Field(Integer)
-
 
158
    using_options(shortnames=True)
-
 
159
    using_table_options(mysql_engine="InnoDB")
-
 
160
    
-
 
161
class OOSStatus(Entity):
-
 
162
    item_id = Field(Integer, primary_key=True, autoincrement=False)
-
 
163
    date = Field(DateTime, primary_key=True, autoincrement=False)
-
 
164
    is_oos = Field(Boolean)
-
 
165
    num_orders = Field(Integer)
-
 
166
    using_options(shortnames=True)
-
 
167
    using_table_options(mysql_engine="InnoDB")
-
 
168
    
154
def initialize(dbname='inventory', db_hostname="localhost"):
169
def initialize(dbname='inventory', db_hostname="localhost"):
155
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
170
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
156
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
171
    #metadata.bind = 'mysql://root:shop2020@localhost/inventory'
157
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
172
    iengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
158
    metadata.bind = iengine
173
    metadata.bind = iengine