| Line 254... |
Line 254... |
| 254 |
billingWarehouseId = Field(Integer)
|
254 |
billingWarehouseId = Field(Integer)
|
| 255 |
sellingPrice = Field(Float)
|
255 |
sellingPrice = Field(Float)
|
| 256 |
using_options(shortnames=True)
|
256 |
using_options(shortnames=True)
|
| 257 |
using_table_options(mysql_engine="InnoDB")
|
257 |
using_table_options(mysql_engine="InnoDB")
|
| 258 |
|
258 |
|
| - |
|
259 |
class VoucherItemMapping(Entity):
|
| - |
|
260 |
voucherType = Field(String(200), primary_key=True)
|
| - |
|
261 |
item = ManyToOne('Item', primary_key=True)
|
| - |
|
262 |
amount = Field(Integer, default=0, server_default="0")
|
| - |
|
263 |
using_options(shortnames=True)
|
| - |
|
264 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
265 |
|
| 259 |
def initialize(dbname='catalog', db_hostname="localhost"):
|
266 |
def initialize(dbname='catalog', db_hostname="localhost"):
|
| 260 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
267 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 261 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
268 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 262 |
engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
269 |
engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
| 263 |
metadata.bind = engine
|
270 |
metadata.bind = engine
|