1👍
✅
Make total_weight a property that calls a queryset and then return the sum, there isn’t any need to save it to the database.
@property
def total_weight(self):
return queryset_with_sum_annotation.values('sum_value').sum_value
Source:stackexchange.com