| Line 194... |
Line 194... |
| 194 |
item = ManyToOne('Item', primary_key=True)
|
194 |
item = ManyToOne('Item', primary_key=True)
|
| 195 |
email = Field(String(100), primary_key=True, autoincrement=False)
|
195 |
email = Field(String(100), primary_key=True, autoincrement=False)
|
| 196 |
addedOn = Field(DateTime, primary_key=True, autoincrement=False)
|
196 |
addedOn = Field(DateTime, primary_key=True, autoincrement=False)
|
| 197 |
using_options(shortnames=True)
|
197 |
using_options(shortnames=True)
|
| 198 |
using_table_options(mysql_engine="InnoDB")
|
198 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
199 |
|
| - |
|
200 |
class Source(Entity):
|
| - |
|
201 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| - |
|
202 |
name = Field(String(50))
|
| - |
|
203 |
identifier = Field(String(100))
|
| - |
|
204 |
using_options(shortnames=True)
|
| - |
|
205 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
206 |
|
| - |
|
207 |
class SourceItemPricing(Entity):
|
| - |
|
208 |
source = ManyToOne('Source', primary_key=True)
|
| - |
|
209 |
item = ManyToOne('Item', primary_key=True)
|
| - |
|
210 |
mrp = Field(Float)
|
| - |
|
211 |
sellingPrice = Field(Float)
|
| - |
|
212 |
using_options(shortnames=True)
|
| - |
|
213 |
using_table_options(mysql_engine="InnoDB")
|
| 199 |
|
214 |
|
| 200 |
def initialize(dbname='catalog', db_hostname="localhost"):
|
215 |
def initialize(dbname='catalog', db_hostname="localhost"):
|
| 201 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
216 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 202 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
217 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 203 |
engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
218 |
engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|