I have a developed a filter which does alot of database queries in my django templete. I have several uses for the same filter with the same values which will provide the same result on the same templete. I wish to save the filter result in a variable within the templete so I can make sure I dont re-run the same queries over again.
I cant send this from my view because I am doing this filter call in a for loop for each object in my model.
an example of what I need can be seen in the url tag :
{% url 'path.to.view' arg arg2 as the_url %}
I need the “as” operation over a filter.
1 Answer