Removing everything I can from template tags, putting them into models or views. Found a useful little hack when comparing integers and strings in templates: http://victorelu.com/blog/comparing-string-with-integer-in-djangos-template/