| Line 170... |
Line 170... |
| 170 |
|
170 |
|
| 171 |
def __repr__(self):
|
171 |
def __repr__(self):
|
| 172 |
return "<Log><id>%d</id><item>%d</item><old_status>%d</old_status><new_status>%d</new_status></Log>" %(self.id,self.item.id, self.old_status, self.new_status)
|
172 |
return "<Log><id>%d</id><item>%d</item><old_status>%d</old_status><new_status>%d</new_status></Log>" %(self.id,self.item.id, self.old_status, self.new_status)
|
| 173 |
|
173 |
|
| 174 |
class Category(Entity):
|
174 |
class Category(Entity):
|
| 175 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
175 |
id = Field(Integer, primary_key=True, autoincrement=False)
|
| 176 |
object = Field(Binary)
|
176 |
label = Field(String(50))
|
| - |
|
177 |
description = Field(String(200))
|
| - |
|
178 |
parent_category_id = Field(Integer)
|
| 177 |
using_options(shortnames=True)
|
179 |
using_options(shortnames=True)
|
| 178 |
using_table_options(mysql_engine="InnoDB")
|
180 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
181 |
|
| 179 |
|
182 |
|
| 180 |
def initialize(dbname='catalog'):
|
183 |
def initialize(dbname='catalog'):
|
| 181 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
184 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 182 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
185 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 183 |
engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
|
186 |
engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
|