Rev 20954 | Blame | Compare with Previous | Last modification | View Log | RSS feed
'''Created on 19-Sep-2012@author: mandeep'''from elixir.entity import Entityfrom elixir.fields import Fieldfrom elixir.options import using_options, using_table_optionsfrom elixir.relationships import OneToManyfrom sqlalchemy.types import Integerfrom shop2020.thriftpy.model.v1.order.ttypes import UserWallet as tUserWalletclass UserWallet(Entity):'''classdocs'''id = Field(Integer, primary_key=True, autoincrement=True)userId = Field(Integer)amount = Field(Integer)refundable_amount = Field(Integer)userWalletHistory = OneToMany("UserWalletHistory")using_options(shortnames=True)using_table_options(mysql_engine="InnoDB")def __init__(self):'''Constructor'''def to_thrift_object(self, ):'''Copies attributes to thrift object'''thriftObject = tUserWallet()thriftObject.id = self.idthriftObject.userId = self.userIdthriftObject.amount = self.amountthriftObject.refundable_amount = self.refundable_amountreturn thriftObjectdef from_thrift_object(self, thriftUserWallet):self.id = thriftUserWallet.idself.userId = thriftUserWallet.userIdself.amount = thriftUserWallet.amountself.refundable_amount = thriftUserWallet.refundable_amountdef is_valid(self):return True