Subversion Repositories SmartDukaan

Rev

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

'''
Created on 11-Oct-2012

@author: rajveer
'''

from elixir.entity import Entity
from elixir.fields import Field
from elixir.options import using_options, using_table_options
from shop2020.thriftpy.model.v1.order.ttypes import RechargePlan as TRechargePlan
from sqlalchemy.types import String, Integer

class RechargePlan(Entity):
    '''
    classdocs
    '''
    operatorId = Field(Integer)
    name = Field(String(256))
    displayName = Field(String(256))
    description = Field(String(256))
    using_options(shortnames=True)
    using_table_options(mysql_engine="InnoDB")


    def __init__(self):
        '''
        Constructor
        '''

    def to_thrift_object(self):
        rechargePlan = TRechargePlan()
        rechargePlan.operatorId = self.operatorId
        rechargePlan.name = self.name
        rechargePlan.displayName = self.displayName
        rechargePlan.description = self.description
        return rechargePlan

    def from_thrift_object(self, thriftRechargePlan):
        self.operatorId = thriftRechargePlan.operatorId
        self.name = thriftRechargePlan.name
        self.displayName = thriftRechargePlan.displayName
        self.description = thriftRechargePlan.description