Template tags#
The transactions app ships one template-tag library –
transactiontags – with two helper tags. Loaded in
templates with:
- load transactiontags
average_price()– weighted average price across a list of transactions:sum(t.get_value() for t in transactions) / sum(t.amount for t in transactions).transaction_url()– detail URL for a transaction; routes totransactions:open_detailortransactions:closed_detailbased on the transaction’sis_closedflag.