Subversion Repositories SmartDukaan

Rev

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

Rev Author Line No. Line
6159 rajveer 1
'''
2
Created on 11-Oct-2012
3
 
4
@author: rajveer
5
'''
6177 anupam.sin 6
 
7
from elixir.entity import Entity
6159 rajveer 8
from elixir.fields import Field
9
from elixir.options import using_options, using_table_options
10
from shop2020.thriftpy.model.v1.order.ttypes import RechargePlan as TRechargePlan
11
from sqlalchemy.types import String, Integer
12
 
6177 anupam.sin 13
class RechargePlan(Entity):
6159 rajveer 14
    '''
15
    classdocs
16
    '''
17
    operatorId = Field(Integer)
18
    name = Field(String(256))
19
    displayName = Field(String(256))
20
    description = Field(String(256))
21
    using_options(shortnames=True)
22
    using_table_options(mysql_engine="InnoDB")
23
 
24
 
25
    def __init__(self):
26
        '''
27
        Constructor
28
        '''
29
 
30
    def to_thrift_object(self):
31
        rechargePlan = TRechargePlan()
32
        rechargePlan.operatorId = self.operatorId
33
        rechargePlan.name = self.name
34
        rechargePlan.displayName = self.displayName
35
        rechargePlan.description = self.description
36
        return rechargePlan
37
 
38
    def from_thrift_object(self, thriftRechargePlan):
39
        self.operatorId = thriftRechargePlan.operatorId
40
        self.name = thriftRechargePlan.name
41
        self.displayName = thriftRechargePlan.displayName
42
        self.description = thriftRechargePlan.description