From e2a67a954ae710b848d6be7981eee5a47ca6e8e5 Mon Sep 17 00:00:00 2001 From: Romain Bignon Date: Fri, 2 Aug 2013 12:52:01 +0200 Subject: [PATCH] Recipient inherits from Currency --- weboob/capabilities/bank.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/weboob/capabilities/bank.py b/weboob/capabilities/bank.py index 580be9750e..03e756f016 100644 --- a/weboob/capabilities/bank.py +++ b/weboob/capabilities/bank.py @@ -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"" % (self.id, self.label) - @property - def currency_text(self): - return Currency.currency2txt(self.currency) - class Transaction(CapBaseObject): """ -- GitLab