AH! If I remember correctly, I also asked about this when I started
using Django. There's a reason you can't call complex functions in the
template: code separation/DRY/etc.
If you want the data, get it in views.py and pass it to the template.
The heavy lifting should be done in the views.py (as functions) or
models.py (as class methods) and then passed into the template using
the context.
I was frustrated by this at first, but by the end I was a convert -
makes things much cleaner.