make it work with the template

django templates can only deal with so much python