Subversion Repositories SmartDukaan

Rev

Rev 2823 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
2445 chandransh 1
'''
2
Created on 05-Jul-2011
3
 
4
@author: ashish
5
'''
6
 
7
from elixir.entity import Entity
8
from elixir.fields import Field
2823 chandransh 9
from sqlalchemy.types import String, Integer, DateTime
2445 chandransh 10
from elixir.options import using_options, using_table_options
11
 
12
from shop2020.thriftpy.utils.ttypes import DashboardUser as TDashboardUser
13
 
14
class DashboardUser(Entity):
15
    username = Field(String(30), primary_key=True)
16
    password =  Field(String(30))
17
    warehouseId = Field(Integer)
18
    addedOn = Field(DateTime)
19
    loggedOn = Field(DateTime)
20
    status = Field(Integer)
21
    otherInfo = Field(String(200))
2783 chandransh 22
    role = Field(Integer)
8303 amar.kumar 23
    source = Field(Integer)
2445 chandransh 24
    using_options(shortnames=True)
25
    using_table_options(mysql_engine="InnoDB")
26
 
27
    def to_thrift_object(self):
28
        '''
29
        Returns the thrift object corresponding to this dashboard user object.
30
        Doesn't set the password in the object being returned.
31
        '''
32
        t_dashboard_user = TDashboardUser()
33
        t_dashboard_user.username = self.username
2783 chandransh 34
        t_dashboard_user.role = self.role
2445 chandransh 35
        t_dashboard_user.warehouseId = self.warehouseId
8303 amar.kumar 36
        t_dashboard_user.source = self.source
2445 chandransh 37
        return t_dashboard_user