[Answered ]-Django method call from template sets named variable. How is this even possible?

2👍

Your problem lies in the parameters in your function.

def get_avg_endors*m*nt(self, stakeholder_cache={})

This is creating problem because default parameters are always evaluated when the function is executed. For details, check:

Default Parameter Values in Python

Do this instead:

def get_avg_endors*m*nt(self, stakeholder_cache=None):
    if stakeholder_cache is None:
        stakeholder_cache ={}
👤SivNiz

Leave a comment