Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save ollieglass/4678105 to your computer and use it in GitHub Desktop.
Save ollieglass/4678105 to your computer and use it in GitHub Desktop.
Django view for categorising credit card transactions, from my personal finance mini-hackathon http://ollieglass.com/2013/01/30/personal-finance-mini-hackathon
{% loop through transactions... %}
<td>
{% if not transaction.merchant.category %}
<select data-value="{{ transaction.id }}">
<option value="-1">Not set</option>
{% for category in categories %}
<option value="{{ category.id }}">{{ category.name }}</option>
{% endfor %}
</select>
{% else %}
{{ transaction.merchant.category.name }}
{% endif %}
</td>
{% endloop %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment