| Line 309... |
Line 309... |
| 309 |
last_action_time = Field(DateTime)
|
309 |
last_action_time = Field(DateTime)
|
| 310 |
created = Field(DateTime,default=func.now())
|
310 |
created = Field(DateTime,default=func.now())
|
| 311 |
using_options(shortnames=True)
|
311 |
using_options(shortnames=True)
|
| 312 |
using_table_options(mysql_engine="InnoDB")
|
312 |
using_table_options(mysql_engine="InnoDB")
|
| 313 |
|
313 |
|
| - |
|
314 |
class Pushnotifications(Entity):
|
| - |
|
315 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| - |
|
316 |
user_id = Field(Integer(unsigned=True))
|
| - |
|
317 |
notification_campaign_id = Field(Integer(unsigned=True))
|
| - |
|
318 |
type = Field(String(16))
|
| - |
|
319 |
status = Field(Boolean)
|
| - |
|
320 |
message = Field(String(64))
|
| - |
|
321 |
response_time = Field(DateTime)
|
| - |
|
322 |
created = Field(DateTime)
|
| - |
|
323 |
using_options(shortnames=True)
|
| - |
|
324 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
325 |
|
| - |
|
326 |
|
| 314 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
327 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
| 315 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
328 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 316 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
329 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 317 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
330 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
| 318 |
metadata.bind = cengine
|
331 |
metadata.bind = cengine
|