def calculateTotalVists(days):
total = 0
for i in days:
total += i
return total
class ClientTable(tables.Table):
class Meta:
model = Client
fields = ('id', 'name', 'phone')
attrs = {'class': 'table table-striped table-bordered', 'id': 'clients'}
The client model has the field "days" which is a list. I would like to create a custom column which displays the result after days is passed into calculateTotalVists(). However I'm not how I can use accessors with functions.