Subversion Repositories SmartDukaan

Rev

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

Rev 14040 Rev 14769
Line 54... Line 54...
54
    created = Field(DateTime)
54
    created = Field(DateTime)
55
    modified = Field(DateTime)
55
    modified = Field(DateTime)
56
    using_options(shortnames=True)
56
    using_options(shortnames=True)
57
    using_table_options(mysql_engine="InnoDB")
57
    using_table_options(mysql_engine="InnoDB")
58
 
58
 
-
 
59
class Brands(Entity):
-
 
60
    id = Field(Integer(unsigned=True), primary_key=True)
-
 
61
    name = Field(String(128))
-
 
62
    category_id = Field(Integer)
-
 
63
    using_options(shortnames=True)
-
 
64
    using_table_options(mysql_engine="InnoDB")
-
 
65
 
59
 
66
 
60
def initialize(dbname='dtr', db_hostname="localhost"):
67
def initialize(dbname='dtr', db_hostname="localhost"):
61
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
68
    #metadata.bind = "sqlite:///inventory-new.sqlite" #need to read it from configserver.
62
    #metadata.bind = 'mysql://root:shop2020@localhost/catalog'
69
    #metadata.bind = 'mysql://root:shop2020@localhost/catalog'
63
    cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)
70
    cengine = create_engine('mysql://root:shop2020@' + db_hostname + '/' + dbname, pool_recycle=7200)