Subversion Repositories SmartDukaan

Rev

Rev 3187 | Rev 5864 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3187 Rev 4806
Line 79... Line 79...
79
    username = Field(String(30), primary_key=True)
79
    username = Field(String(30), primary_key=True)
80
    password =  Field(String(30))
80
    password =  Field(String(30))
81
    loggedOn = Field(DateTime)
81
    loggedOn = Field(DateTime)
82
    role = Field(Integer)
82
    role = Field(Integer)
83
    using_options(shortnames=True)
83
    using_options(shortnames=True)
84
    using_table_options(mysql_engine="InnoDB")    
84
    using_table_options(mysql_engine="InnoDB")
85
    
85
    
-
 
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
 
86
def initialize(dbname='helper', db_hostname='localhost'):
100
def initialize(dbname='helper', db_hostname='localhost'):
87
    #metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
101
    #metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
88
    engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
102
    engine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
89
    metadata.bind = engine
103
    metadata.bind = engine
90
    metadata.bind.echo = True
104
    metadata.bind.echo = True