python jinja template with logic expression in template file