0

My models.py:

class Aff(models.Model):
    name = models.CharField(max_length=32)
    ...

    def somefunction(self, variable):
        #something
        return result

    def somefunction2(self):
        #something
        return result

My template.html:

{% for a in aff_list %}
    {{ a.somefunction(var) }}
{% endfor %}

It gives this error: Could not parse the remainder: '(var)' from 'a.somefunction(var)'. somefunction2 instead works. Maybe it's a stupid question but I can't find the solution and it's some hours that I work on it, so someone can help me please?

fabio
  • 1,082
  • 1
  • 24
  • 47

0 Answers0