Inverting list comprehension in templates for better readability