Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[REQUEST] option to aggregate sum by currency #712

Open
joshuakoh1 opened this issue May 17, 2023 · 0 comments
Open

[REQUEST] option to aggregate sum by currency #712

joshuakoh1 opened this issue May 17, 2023 · 0 comments

Comments

@joshuakoh1
Copy link

For a MoneyField

price = MoneyField()

Requesting an equivalent of the following as a Money object or list of Money objects:

objects.aggregate(total=Sum('price'))
objects.values('price_currency').orderby('price_currency').annotate(total=Sum('price'))

Right now I have to loop through the results and manually create Money instances as a new list

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant