[Fixed]-Django model function in template Could not parse the remainder: '()'

1👍

Instead of using claim.follow_up_date() as function, just use claim.follow_up_date in your django template and it will work. i.e.

{% for claim in claims %}
<tr>
    <td>${{claim.due}}</td>
    <td>{{claim.follow_up_date}}</td>
</tr>
{% endfor %}

0👍

Use the python’s @property decorator:

@property
def follow_up_date(self):
    return self.date_worked+timedelta(days=self.follow_up_days)

And the in your template:

...
<td>{{claim.follow_up_date}}</td>
...
👤Gocht

Leave a comment