Recipient inherits from Currency
This commit is contained in:
parent
f9dc0d7cbd
commit
e2a67a954a
1 changed files with 7 additions and 7 deletions
|
|
@ -43,18 +43,23 @@ class TransferError(UserError):
|
|||
"""
|
||||
|
||||
|
||||
class Recipient(CapBaseObject):
|
||||
class Recipient(CapBaseObject, Currency):
|
||||
"""
|
||||
Recipient of a transfer.
|
||||
"""
|
||||
|
||||
label = StringField('Name')
|
||||
currency = IntField('Currency', default=Currency.CUR_UNKNOWN)
|
||||
|
||||
def __init__(self):
|
||||
CapBaseObject.__init__(self, 0)
|
||||
|
||||
@property
|
||||
def currency_text(self):
|
||||
return Currency.currency2txt(self.currency)
|
||||
|
||||
class Account(Recipient, Currency):
|
||||
|
||||
class Account(Recipient):
|
||||
"""
|
||||
Bank account.
|
||||
|
||||
|
|
@ -72,15 +77,10 @@ class Account(Recipient, Currency):
|
|||
type = IntField('Type of account', default=TYPE_UNKNOWN)
|
||||
balance = DecimalField('Balance on this bank account')
|
||||
coming = DecimalField('Coming balance')
|
||||
currency = IntField('Currency', default=Currency.CUR_UNKNOWN)
|
||||
|
||||
def __repr__(self):
|
||||
return u"<Account id=%r label=%r>" % (self.id, self.label)
|
||||
|
||||
@property
|
||||
def currency_text(self):
|
||||
return Currency.currency2txt(self.currency)
|
||||
|
||||
|
||||
class Transaction(CapBaseObject):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue