Saturday, January 30, 2021

Re: multiplying two fields

This will work 

data = Articles.objects.all().annotate(result=ExpressionWrapper(F('cost_buy') * F('quantity') , output_field=FloatField()))
now data is a queryset. so you can do something like this

You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To view this discussion on the web visit

No comments:

Post a Comment