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

fix: django-money display support in display_for_field #942

Open
groig opened this issue Jan 7, 2025 · 0 comments
Open

fix: django-money display support in display_for_field #942

groig opened this issue Jan 7, 2025 · 0 comments
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@groig
Copy link

groig commented Jan 7, 2025

What version of Unfold are you using?

0.43.0

What version of Django are you using?

5.1.4

What browser are you using?

133.0.3

Did you checked changelog/commit history, if the bug is not already fixed?

Yes

Did you searched other issues, if the bug is not already fixed?

Yes

Did you checked documentation?

Yes

Are you able to replicate the bug in the demo site?
There are no tables with money field columns

Describe your issue

Currently, Unfold's display_for_field function in admin.py does not handle django-money's MoneyField, resulting in inconsistent or incorrect formatting of MoneyField values in list views like the ones mentioned here django-money/django-money#220.

For example, these prices with the en locale:

image

are displayed like this when the locale switches to es:

image

django-money provides a function that patches Django's display_for_field here but unfold uses its own implementation that renders MoneyField as DecimalField leading to the incorrect display of the values.

@lukasvinclav lukasvinclav added the bug Something isn't working label Jan 14, 2025
@lukasvinclav lukasvinclav changed the title Support for django-money's MoneyField in display_for_field fix: django-money display support in display_for_field Jan 14, 2025
@lukasvinclav lukasvinclav added the good first issue Good for newcomers label Jan 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants