| 353 |
ashish |
1 |
'''
|
|
|
2 |
Created on 14-Jul-2010
|
|
|
3 |
|
|
|
4 |
@author: ashish
|
|
|
5 |
'''
|
| 1131 |
chandransh |
6 |
from sqlalchemy import create_engine
|
| 353 |
ashish |
7 |
from elixir import *
|
| 746 |
rajveer |
8 |
import elixir
|
| 353 |
ashish |
9 |
|
|
|
10 |
class Message(Entity):
|
|
|
11 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
12 |
message_id = Field(Integer)
|
|
|
13 |
message = Field(String(200))
|
| 746 |
rajveer |
14 |
using_options(shortnames=True)
|
|
|
15 |
using_table_options(mysql_engine="InnoDB")
|
| 353 |
ashish |
16 |
|
| 494 |
rajveer |
17 |
class DashboardUser(Entity):
|
|
|
18 |
username = Field(String(30), primary_key=True)
|
|
|
19 |
password = Field(String(30))
|
|
|
20 |
warehouseId = Field(Integer)
|
|
|
21 |
addedOn = Field(DateTime)
|
|
|
22 |
loggedOn = Field(DateTime)
|
|
|
23 |
status = Field(Integer)
|
|
|
24 |
otherInfo = Field(String(200))
|
| 746 |
rajveer |
25 |
using_options(shortnames=True)
|
|
|
26 |
using_table_options(mysql_engine="InnoDB")
|
| 353 |
ashish |
27 |
|
| 759 |
chandransh |
28 |
class LogisticsUser(Entity):
|
|
|
29 |
username = Field(String(30), primary_key=True)
|
|
|
30 |
password = Field(String(30))
|
|
|
31 |
providerId = Field(Integer)
|
|
|
32 |
using_options(shortnames=True)
|
|
|
33 |
using_table_options(mysql_engine="InnoDB")
|
|
|
34 |
|
| 1610 |
ankur.sing |
35 |
class StatisticsUser(Entity):
|
|
|
36 |
username = Field(String(30), primary_key=True)
|
|
|
37 |
password = Field(String(30))
|
|
|
38 |
using_options(shortnames=True)
|
|
|
39 |
using_table_options(mysql_engine="InnoDB")
|
|
|
40 |
|
| 1891 |
ankur.sing |
41 |
class Report(Entity):
|
|
|
42 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
43 |
description = Field(String(100))
|
|
|
44 |
controller = Field(String(100))
|
|
|
45 |
using_options(shortnames=True)
|
|
|
46 |
using_table_options(mysql_engine="InnoDB")
|
|
|
47 |
|
|
|
48 |
class ReportUser(Entity):
|
|
|
49 |
username = Field(String(30), primary_key=True)
|
|
|
50 |
password = Field(String(30))
|
|
|
51 |
role = Field(Integer)
|
|
|
52 |
using_options(shortnames=True)
|
|
|
53 |
using_table_options(mysql_engine="InnoDB")
|
|
|
54 |
|
|
|
55 |
class ReportRoleAuthority(Entity):
|
|
|
56 |
report = ManyToOne("Report", primary_key=True)
|
|
|
57 |
role = Field(Integer, primary_key=True)
|
|
|
58 |
using_options(shortnames=True)
|
|
|
59 |
using_table_options(mysql_engine="InnoDB")
|
|
|
60 |
|
| 1395 |
varun.gupt |
61 |
class UserEmail(Entity):
|
| 1422 |
varun.gupt |
62 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| 1395 |
varun.gupt |
63 |
emailTo = Field(String(100))
|
|
|
64 |
emailFrom = Field(String(60))
|
|
|
65 |
subject = Field(String(120))
|
|
|
66 |
body = Field(Text())
|
|
|
67 |
source = Field(String(20))
|
|
|
68 |
emailType = Field(String(40))
|
|
|
69 |
status = Field(Boolean())
|
|
|
70 |
timestamp = Field(DateTime())
|
|
|
71 |
using_options(shortnames=True)
|
|
|
72 |
using_table_options(mysql_engine="InnoDB")
|
|
|
73 |
|
| 2025 |
ankur.sing |
74 |
class CatalogDashboardUser(Entity):
|
|
|
75 |
username = Field(String(30), primary_key=True)
|
|
|
76 |
password = Field(String(30))
|
|
|
77 |
loggedOn = Field(DateTime)
|
|
|
78 |
using_options(shortnames=True)
|
|
|
79 |
using_table_options(mysql_engine="InnoDB")
|
|
|
80 |
|
| 1248 |
chandransh |
81 |
def initialize(dbname='helper'):
|
| 746 |
rajveer |
82 |
#metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
|
| 1248 |
chandransh |
83 |
engine = create_engine('mysql://root:shop2020@localhost/' + dbname, pool_recycle=7200)
|
| 1131 |
chandransh |
84 |
metadata.bind = engine
|
| 353 |
ashish |
85 |
metadata.bind.echo = True
|
|
|
86 |
setup_all(True)
|
|
|
87 |
|
|
|
88 |
if __name__=="__main__":
|
|
|
89 |
initialize()
|
| 759 |
chandransh |
90 |
|