[Fixed]-How to mix Sum and arithmetic with Django queryset

1👍

Try something like this:

from django.db.models import Value

.annotate(quantity_to_order=Sum('quantity') / Value(Command.avg_on_x_week))

Leave a comment