Good morning: I have a model Order and I need general a summary of all the orders that have been generated in the last 15 days, then I want to generate the total of all the orders and I do not know how to do it. for the moment I have this:
pedidos = Pedido.objects.filter(fecha_pedido__range = [año + '-' + mes +'-'+ ini, anno + '-' + mes +'-' + fin])
rows=pedidos.order_by('numero_cuenta').values_list('usuario','nombre_completo','dni','banco','numero_cuenta','tipo_cuenta','precio_producto','comision','impuesto','total')
This brings me all the orders but I want to make a kind of distinct and add a calculated field that is the sum of the total field of all orders of each user