Greetings:

I am having a problem using the above function.

In my table I have a field payment that is a foreign key to a payment table.

When I try to use aggregate(sum('payment')) it gives me the sum of the 
foreign key, not the value from the payment table.
Currently I have 9 records in my test DB each one has a foreign key of 3 so 
I get a sum of 27 not 2,250 that I should be getting.

This table also has a foreign key to the customer table and it returns the 
customer not the foreign key number.

The thought I had was to make that foreign key an integer field and then 
the user would have to enter a number instead of selecting it from a list, 
prone to operator errors,

Any ideas on how I can get the correct totals using ORM.

Thanks


-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-users/c47e4bb7-626c-4b07-9ab5-55d68fe4d566%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to