Re: DecimalField
Morning all,
-- More information which may suggest I need to enter a bug with the Django team.
If I remove my own custom error_messages dictionary for the Decimal Field in my ModelForm all validation works as it should using the default error messages built into Django.
On Tuesday, August 27, 2013 9:43:59 AM UTC-4, Derrick Jackson wrote:
On Tuesday, August 27, 2013 9:43:59 AM UTC-4, Derrick Jackson wrote:
Thanks Tom. I actually tried that at one point and this is the error I received: not all arguments converted during string formatting.The required and invalid error message keys work fine but it appears the max_decimal_places key is being ignored. Has anyone seen this before? BTW, I am using Django 1.5.2
On Sunday, August 25, 2013 5:47:00 AM UTC-4, Derrick Jackson wrote:Hi All,My Model has a DecimalField:amount = models.DecimalField(max_digits=19, decimal_places=2, verbose_name='Amount') My ModelForm has the following:self.fields['amount'] = forms.DecimalField(error_messages={ 'required': 'Amount is required.','invalid': 'Numbers only.','max_decimal_places': 'Only 2 decimal places.'})However the max_decimal_places validation check does not seem to be working. Is there a certain way I need to use this that will properly allow the error to be thrown?
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 django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/28440d2f-50d2-4a5a-b4a2-e5e32ff871db%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home