Subversion Repositories SmartDukaan

Rev

Rev 746 | Rev 1131 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

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