implement mandatory fields for custom formatters
This commit is contained in:
parent
bebd4318ec
commit
560798bf7d
6 changed files with 37 additions and 1 deletions
|
|
@ -27,6 +27,8 @@ __all__ = ['Boobank']
|
|||
|
||||
|
||||
class TransferFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'date', 'origin', 'recipient', 'amount')
|
||||
|
||||
def flush(self):
|
||||
pass
|
||||
|
||||
|
|
@ -38,7 +40,10 @@ class TransferFormatter(IFormatter):
|
|||
result += u'Amount: %.2f\n' % item['amount']
|
||||
return result
|
||||
|
||||
|
||||
class AccountListFormatter(IFormatter):
|
||||
MANDATORY_FIELDS = ('id', 'label', 'balance', 'coming')
|
||||
|
||||
count = 0
|
||||
tot_balance = 0.0
|
||||
tot_coming = 0.0
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue