I have an expensive function call that gets called once per loop, but I would like to set the return value of that to be a temporary variable that can be used directly within the loop.
This works by setting {{ val=fn(...) }}, but it also prints to the screen. Is it possible to do this without printing the value?
I’ve tried using one set of curly braces {} but it doesn’t work.
Any ideas on how to do this?
Have you looked into “filters” or possibly doing the work in your JS code instead of the view?