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>
...
- Fetching objects in complex through relationship Django
- Django Insert html into div using jquery .ajax() on button click
- Django Include file repeating itself in production only
- NoReverseMatch in Django; views and urls are properly defined
Source:stackexchange.com