Subversion Repositories SmartDukaan

Rev

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

Rev 15135 Rev 15138
Line 149... Line 149...
149
    using_options(shortnames=True)
149
    using_options(shortnames=True)
150
    using_table_options(mysql_engine="InnoDB")
150
    using_table_options(mysql_engine="InnoDB")
151
    
151
    
152
class RetailerLinks(Entity):
152
class RetailerLinks(Entity):
153
    retailer_id = Field(Integer(unsigned=True))
153
    retailer_id = Field(Integer(unsigned=True))
-
 
154
    agent_id = Field(Integer(unsigned=True))
154
    code = Field(String(10), unique=True)
155
    code = Field(String(10), unique=True)
155
    is_activated = Field(Boolean)
156
    is_activated = Field(Boolean)
156
    activated = Field(DateTime,onupdate=func.now())
157
    activated = Field(DateTime,onupdate=func.now())
157
    created = Field(DateTime,default=func.now())
158
    created = Field(DateTime,default=func.now())
158
    using_options(shortnames=True)
159
    using_options(shortnames=True)
159
    using_table_options(mysql_engine="InnoDB")
160
    using_table_options(mysql_engine="InnoDB")
160
    
161
    
161
class Activation_Codes(Entity):
162
class Activation_Codes(Entity):
162
    code = Field(String(10))
163
    code = Field(String(10))
163
    created = Field(DateTime, defalut=func.now())
164
    created = Field(DateTime, default=func.now())
164
 
165
 
165
 
166
 
166
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
167
def initialize(dbname='dtr', db_hostname="localhost", echo=True):
167
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
168
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
168
    #metadata.bind = 'mysql://root:shop2020@localhost/catalog'
169
    #metadata.bind = 'mysql://root:shop2020@localhost/catalog'