| 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 |
|
| 2445 |
chandransh |
10 |
from shop2020.helpers.impl.model import DashboardUser
|
|
|
11 |
|
| 353 |
ashish |
12 |
class Message(Entity):
|
|
|
13 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
14 |
message_id = Field(Integer)
|
|
|
15 |
message = Field(String(200))
|
| 746 |
rajveer |
16 |
using_options(shortnames=True)
|
|
|
17 |
using_table_options(mysql_engine="InnoDB")
|
| 353 |
ashish |
18 |
|
| 759 |
chandransh |
19 |
class LogisticsUser(Entity):
|
|
|
20 |
username = Field(String(30), primary_key=True)
|
|
|
21 |
password = Field(String(30))
|
|
|
22 |
providerId = Field(Integer)
|
|
|
23 |
using_options(shortnames=True)
|
|
|
24 |
using_table_options(mysql_engine="InnoDB")
|
|
|
25 |
|
| 1610 |
ankur.sing |
26 |
class StatisticsUser(Entity):
|
|
|
27 |
username = Field(String(30), primary_key=True)
|
|
|
28 |
password = Field(String(30))
|
|
|
29 |
using_options(shortnames=True)
|
|
|
30 |
using_table_options(mysql_engine="InnoDB")
|
|
|
31 |
|
| 1891 |
ankur.sing |
32 |
class Report(Entity):
|
|
|
33 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
|
|
34 |
description = Field(String(100))
|
|
|
35 |
controller = Field(String(100))
|
|
|
36 |
using_options(shortnames=True)
|
|
|
37 |
using_table_options(mysql_engine="InnoDB")
|
|
|
38 |
|
|
|
39 |
class ReportUser(Entity):
|
|
|
40 |
username = Field(String(30), primary_key=True)
|
|
|
41 |
password = Field(String(30))
|
|
|
42 |
role = Field(Integer)
|
|
|
43 |
using_options(shortnames=True)
|
|
|
44 |
using_table_options(mysql_engine="InnoDB")
|
|
|
45 |
|
|
|
46 |
class ReportRoleAuthority(Entity):
|
|
|
47 |
report = ManyToOne("Report", primary_key=True)
|
|
|
48 |
role = Field(Integer, primary_key=True)
|
|
|
49 |
using_options(shortnames=True)
|
|
|
50 |
using_table_options(mysql_engine="InnoDB")
|
|
|
51 |
|
| 1395 |
varun.gupt |
52 |
class UserEmail(Entity):
|
| 1422 |
varun.gupt |
53 |
id = Field(Integer, primary_key=True, autoincrement=True)
|
| 1395 |
varun.gupt |
54 |
emailTo = Field(String(100))
|
|
|
55 |
emailFrom = Field(String(60))
|
|
|
56 |
subject = Field(String(120))
|
|
|
57 |
body = Field(Text())
|
|
|
58 |
source = Field(String(20))
|
|
|
59 |
emailType = Field(String(40))
|
|
|
60 |
status = Field(Boolean())
|
|
|
61 |
timestamp = Field(DateTime())
|
|
|
62 |
using_options(shortnames=True)
|
|
|
63 |
using_table_options(mysql_engine="InnoDB")
|
|
|
64 |
|
| 3005 |
chandransh |
65 |
class UserEmailArchive(Entity):
|
|
|
66 |
id = Field(Integer, primary_key=True)
|
|
|
67 |
emailTo = Field(String(100))
|
|
|
68 |
emailFrom = Field(String(60))
|
|
|
69 |
subject = Field(String(120))
|
|
|
70 |
body = Field(Text())
|
|
|
71 |
source = Field(String(20))
|
|
|
72 |
emailType = Field(String(40))
|
|
|
73 |
status = Field(Boolean())
|
|
|
74 |
timestamp = Field(DateTime())
|
|
|
75 |
using_options(shortnames=True)
|
|
|
76 |
using_table_options(mysql_engine="InnoDB")
|
|
|
77 |
|
| 2025 |
ankur.sing |
78 |
class CatalogDashboardUser(Entity):
|
|
|
79 |
username = Field(String(30), primary_key=True)
|
|
|
80 |
password = Field(String(30))
|
|
|
81 |
loggedOn = Field(DateTime)
|
| 2358 |
ankur.sing |
82 |
role = Field(Integer)
|
| 2025 |
ankur.sing |
83 |
using_options(shortnames=True)
|
| 4806 |
varun.gupt |
84 |
using_table_options(mysql_engine="InnoDB")
|
| 2025 |
ankur.sing |
85 |
|
| 4806 |
varun.gupt |
86 |
class EntitiesShared(Entity):
|
|
|
87 |
entityIds = Field(String(100))
|
|
|
88 |
email = Field(String(100))
|
|
|
89 |
isEmailed = Field(Boolean)
|
|
|
90 |
using_options(shortnames=True)
|
|
|
91 |
using_table_options(mysql_engine="InnoDB")
|
|
|
92 |
|
|
|
93 |
class QuickLink(Entity):
|
|
|
94 |
id = Field(Integer, primary_key=True)
|
|
|
95 |
url = Field(String(220))
|
|
|
96 |
text = Field(String(220))
|
|
|
97 |
using_options(shortnames = True)
|
|
|
98 |
using_table_options(mysql_engine = "InnoDB")
|
|
|
99 |
|
| 3187 |
rajveer |
100 |
def initialize(dbname='helper', db_hostname='localhost'):
|
| 746 |
rajveer |
101 |
#metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
|
| 3187 |
rajveer |
102 |
engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
| 1131 |
chandransh |
103 |
metadata.bind = engine
|
| 353 |
ashish |
104 |
metadata.bind.echo = True
|
|
|
105 |
setup_all(True)
|
|
|
106 |
|
|
|
107 |
if __name__=="__main__":
|
|
|
108 |
initialize()
|
| 759 |
chandransh |
109 |
|