Subversion Repositories SmartDukaan

Rev

Rev 22046 | Rev 22048 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 22046 Rev 22047
Line 4... Line 4...
4
@author: rajveer
4
@author: rajveer
5
'''
5
'''
6
from elixir.entity import Entity
6
from elixir.entity import Entity
7
from elixir.fields import Field
7
from elixir.fields import Field
8
from elixir.options import using_options, using_table_options
8
from elixir.options import using_options, using_table_options
9
from sqlalchemy.types import Integer, DateTime, String
-
 
10
from elixir.relationships import ManyToOne
9
from elixir.relationships import ManyToOne
-
 
10
from shop2020.thriftpy.model.v1.order.ttypes import \
-
 
11
    UserWalletHistory as tUserWalletHistory, WalletReferenceType
11
from shop2020.utils.Utils import to_py_date, to_java_date
12
from shop2020.utils.Utils import to_py_date, to_java_date
12
from shop2020.thriftpy.model.v1.order.ttypes import UserWalletHistory as tUserWalletHistory
13
from sqlalchemy.types import Integer, DateTime, String
13
 
14
 
14
class UserWalletHistory(Entity):
15
class UserWalletHistory(Entity):
15
    '''
16
    '''
16
    classdocs
17
    classdocs
17
    '''
18
    '''
Line 42... Line 43...
42
        thriftObject.amount = self.amount
43
        thriftObject.amount = self.amount
43
        thriftObject.walletId = self.wallet.id
44
        thriftObject.walletId = self.wallet.id
44
        thriftObject.timestamp = to_java_date(self.timestamp)
45
        thriftObject.timestamp = to_java_date(self.timestamp)
45
        thriftObject.referenceNumber = self.reference
46
        thriftObject.referenceNumber = self.reference
46
        thriftObject.referenceType = self.reference_type
47
        thriftObject.referenceType = self.reference_type
47
        thriftObject.description = self.description
48
        thriftObject.description = WalletReferenceType._NAMES_TO_VALUES(self.description)
48
        return thriftObject
49
        return thriftObject
49
    
50
    
50
    def from_thrift_object(self, thriftUserWalletHistory):
51
    def from_thrift_object(self, thriftUserWalletHistory):
51
        self.id = thriftUserWalletHistory.id
52
        self.id = thriftUserWalletHistory.id
52
        self.amount = thriftUserWalletHistory.amount
53
        self.amount = thriftUserWalletHistory.amount