@@ -26,7 +26,8 @@ class Ledger:
2626 DESCRIPTION
2727 """
2828
29- def __init__ (self , currency , mts , amount , balance , description ):
29+ def __init__ (self , lid , currency , mts , amount , balance , description ):
30+ self .id = lid
3031 self .currency = currency
3132 self .mts = mts
3233 self .amount = amount
@@ -40,15 +41,16 @@ def from_raw_ledger(raw_ledger):
4041
4142 @return Ledger
4243 """
44+ lid = raw_ledger [LedgerModel .ID ]
4345 currency = raw_ledger [LedgerModel .CURRENCY ]
4446 mts = raw_ledger [LedgerModel .MTS ]
4547 amount = raw_ledger [LedgerModel .AMOUNT ]
4648 balance = raw_ledger [LedgerModel .BALANCE ]
4749 description = raw_ledger [LedgerModel .DESCRIPTION ]
48- return Ledger (currency , mts , amount , balance , description )
50+ return Ledger (lid , currency , mts , amount , balance , description )
4951
5052 def __str__ (self ):
5153 ''' Allow us to print the Ledger object in a pretty format '''
52- text = "Ledger <{} {} balance:{} '{}' mts={}>"
53- return text .format (self .amount , self .currency , self .balance ,
54+ text = "Ledger <{} {} {} balance:{} '{}' mts={}>"
55+ return text .format (self .id , self . amount , self .currency , self .balance ,
5456 self .description , self .mts )
0 commit comments