[Fixed]-How to make a dynamic model's field value?

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
👤Sayse

Leave a comment