pynab
pynab copied to clipboard
Its confusing that you can find transactions that aren't in any category
I realise this is an artefact of the way the data is structured but it would be good to have a note in the docs to make people aware of this. IMHO it would be even nicer if when iterating over transactions in a category (or even always) the sub-transactions relevant to said category also appeared in the list just as any other normal transaction.
>>> t = budget.transactions.filter('date', date(2014, 10, 28))[-2]
>>> # t in this case is a transaction with sub transactions (in my budget file)
>>> # t is not in any of the transactions when iterating by category
>>> print any([t in c.transactions for c in budget.categories])
False
>>> print t.category
None
>>> print len(t.sub_transactions)
7