Subversion Repositories SmartDukaan

Rev

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

Rev 494 Rev 746
Line 2... Line 2...
2
Created on 14-Jul-2010
2
Created on 14-Jul-2010
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from elixir import *
6
from elixir import *
-
 
7
import elixir
7
 
8
 
8
class Message(Entity):
9
class Message(Entity):
9
    id = Field(Integer, primary_key=True, autoincrement=True)
10
    id = Field(Integer, primary_key=True, autoincrement=True)
10
    message_id = Field(Integer)
11
    message_id = Field(Integer)
11
    message = Field(String(200))
12
    message = Field(String(200))
-
 
13
    using_options(shortnames=True)
-
 
14
    using_table_options(mysql_engine="InnoDB")
12
    
15
    
13
class DashboardUser(Entity):
16
class DashboardUser(Entity):
14
    username = Field(String(30), primary_key=True)
17
    username = Field(String(30), primary_key=True)
15
    password =  Field(String(30))
18
    password =  Field(String(30))
16
    warehouseId = Field(Integer)
19
    warehouseId = Field(Integer)
17
    addedOn = Field(DateTime)
20
    addedOn = Field(DateTime)
18
    loggedOn = Field(DateTime)
21
    loggedOn = Field(DateTime)
19
    status = Field(Integer)
22
    status = Field(Integer)
20
    otherInfo = Field(String(200))
23
    otherInfo = Field(String(200))
-
 
24
    using_options(shortnames=True)
-
 
25
    using_table_options(mysql_engine="InnoDB")
21
    
26
    
22
def initialize():
27
def initialize():
23
    metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
28
    #metadata.bind = "sqlite:///message.sqlite" #need to read it from configserver.
-
 
29
    metadata.bind = 'mysql://root:shop2020@localhost/helper'
24
    metadata.bind.echo = True
30
    metadata.bind.echo = True
25
    setup_all(True)
31
    setup_all(True)
26
 
32
 
27
if __name__=="__main__":
33
if __name__=="__main__":
28
    initialize()
34
    initialize()