how can I get objects that are associated with a user
I am creating this app for managing/tracking customers
I have form which is used to save customer personal info and another field which is how much they are willing to spend + We can assign the customer to a user to be dealt with.
e.g. user1 assigned to customer1, customer2, customer3
I want to get one amount they willing to spend from all customers assigned to user1
So for example something like this
[<user1: <customer1:$10> <customer2:$100> <customer3:$1000>]
And then sum the prices together so something like this [<user1: total:$1110>]
this is what I done but doesn't seem to work
annual_spend = Lead.objects.filter(assign_to=User).exclude(lead_status='converted').aggregate(Sum('annual_spend'))
How could I do this any ideas?