| Line 162... |
Line 162... |
| 162 |
code = Field(String(10))
|
162 |
code = Field(String(10))
|
| 163 |
created = Field(DateTime, default=func.now())
|
163 |
created = Field(DateTime, default=func.now())
|
| 164 |
using_options(shortnames=True)
|
164 |
using_options(shortnames=True)
|
| 165 |
using_table_options(mysql_engine="InnoDB")
|
165 |
using_table_options(mysql_engine="InnoDB")
|
| 166 |
|
166 |
|
| - |
|
167 |
class Agents(Entity):
|
| - |
|
168 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| - |
|
169 |
name = Field(String(64))
|
| - |
|
170 |
email = Field(String(100))
|
| - |
|
171 |
password = Field(String(64))
|
| - |
|
172 |
type = Field(Enum('crm','fos'))
|
| - |
|
173 |
last_login = Field(DateTime)
|
| - |
|
174 |
created = Field(DateTime, default=func.now())
|
| - |
|
175 |
using_options(shortnames=True)
|
| - |
|
176 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
177 |
|
| - |
|
178 |
class Agent_Roles(Entity):
|
| - |
|
179 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| - |
|
180 |
agent_id = Field(Integer(unsigned=True))
|
| - |
|
181 |
role = Field(Enum('fresh','followup','onboarding'))
|
| - |
|
182 |
created = Field(DateTime, default=func.now())
|
| - |
|
183 |
using_options(shortnames=True)
|
| - |
|
184 |
using_table_options(mysql_engine="InnoDB")
|
| 167 |
|
185 |
|
| - |
|
186 |
class AgentLoginTimings(Entity):
|
| - |
|
187 |
id = Field(Integer(unsigned=True), primary_key=True)
|
| - |
|
188 |
agent_id = Field(Integer(unsigned=True))
|
| - |
|
189 |
role = Field(Enum('fresh','followup','onboarding'))
|
| - |
|
190 |
loginTime = Field(DateTime)
|
| - |
|
191 |
logoutTime = Field(DateTime)
|
| - |
|
192 |
created = Field(DateTime, default=func.now())
|
| - |
|
193 |
using_options(shortnames=True)
|
| - |
|
194 |
using_table_options(mysql_engine="InnoDB")
|
| - |
|
195 |
|
| 168 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
196 |
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
|
| 169 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
197 |
#metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
|
| 170 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
198 |
#metadata.bind = 'mysql://root:shop2020@localhost/catalog'
|
| 171 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
199 |
cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
|
| 172 |
metadata.bind = cengine
|
200 |
metadata.bind = cengine
|