Localization and Forms with Currencyfields / Value

60 views
Skip to first unread message

Christian Schmitt

unread,
Jun 15, 2013, 5:35:29 AM6/15/13
to django-d...@googlegroups.com
In Django it is nearly impossible to deal with currency values, intcomma would make values to currency and it will work on Django 1.6a1 with Decimals, 
but still when I have a ModelForm or Form I can't validate a intcomma(Decimal()) Value. It will always be incorrect.
Maybe its time now to let Django have a CurrencyField in core or even better functions for dealing with currency values.

I mean I would maybe contribute something to django, but maybe i'm too scared that my code isn't correct or even not that good to get contributed.
It would just be another improvement for django when the handling of Currencies would be less worse than it is now.

Aymeric Augustin

unread,
Jun 15, 2013, 10:31:21 AM6/15/13
to django-d...@googlegroups.com
Hi Christian,

Could you clarify why DecimalField doesn't work for your use case?

I suspect you're encountering problems related to localization, but I'm not sure.

Thanks,

-- 
Aymeric.



--
You received this message because you are subscribed to the Google Groups "Django developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-develop...@googlegroups.com.
To post to this group, send email to django-d...@googlegroups.com.
Visit this group at http://groups.google.com/group/django-developers.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Christian Schmitt

unread,
Jun 16, 2013, 4:59:04 PM6/16/13
to django-d...@googlegroups.com
The Thing is, some Application that dealing with money have thousand separator, and fields without. So it won't work. I've wrote my own Field since, I need to deal with both, but I think this is a feature that should be included in the core of django.
Or even something like models.DecimalField(grouping=True) not sure how but I think its not good to turn THOUSAND_SEPERATOR on globally.
I've encountered localization problems with some template filters especially with intcomma.
Reply all
Reply to author
Forward
0 new messages