| Line 188... |
Line 188... |
| 188 |
item = ManyToOne('Item', primary_key=True)
|
188 |
item = ManyToOne('Item', primary_key=True)
|
| 189 |
catalog_item_id = Field(Integer, primary_key=True, autoincrement=False)
|
189 |
catalog_item_id = Field(Integer, primary_key=True, autoincrement=False)
|
| 190 |
using_options(shortnames=True)
|
190 |
using_options(shortnames=True)
|
| 191 |
using_table_options(mysql_engine="InnoDB")
|
191 |
using_table_options(mysql_engine="InnoDB")
|
| 192 |
|
192 |
|
| - |
|
193 |
class ProductNotification(Entity):
|
| - |
|
194 |
item = ManyToOne('Item', primary_key=True)
|
| - |
|
195 |
email = Field(String(100), primary_key=True, autoincrement=False)
|
| - |
|
196 |
addedOn = Field(DateTime, primary_key=True, autoincrement=False)
|
| - |
|
197 |
using_options(shortnames=True)
|
| - |
|
198 |
using_table_options(mysql_engine="InnoDB")
|
| 193 |
|
199 |
|
| 194 |
def initialize(dbname='catalog'):
|
200 |
def initialize(dbname='catalog'):
|
| 195 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
201 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 196 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
202 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 197 |
engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
|
203 |
engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
|