#12539: Error while validating non required IntegerField with localflavor form
field
--------------------------------------------+-------------------------------
Reporter: Bernd Schlapsi <b...@gmx.info> | Owner: nobody
Status: new | Milestone: 1.2
Component: Database layer (models, ORM) | Version: SVN
Keywords: | Stage: Unreviewed
Has_patch: 1 |
--------------------------------------------+-------------------------------
There is a validation error when validating a non required IntegerField
and using a localflavor Field for the ModelForm
This is my example models.py
{{{
from django import forms
from django.contrib.localflavor.at.forms import ATZipCodeField
from django.db import models
class Person(models.Model):
first_name = models.CharField(max_length=30)
last_name = models.CharField(max_length=30)
email = models.EmailField()
zip = models.PositiveSmallIntegerField(blank=True, null=True)
class PersonForm(forms.ModelForm):
zip = ATZipCodeField(required=False)
class Meta:
model = Person
}}}
This is how you can reproduce the error
{{{
In [1]: from app.models import PersonForm
In [2]: f = PersonForm({'first_name':'Max', 'last_name':'Mustermann',
'email':'a...@test.com'})
In [3]: f.full_clean()
In [4]: f.errors
Out[4]: {'zip': [u'This value must be a float.']}
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/12539>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To post to this group, send email to django-upda...@googlegroups.com.
To unsubscribe from this group, send email to
django-updates+unsubscr...@googlegroups.com.
For more options, visit this group at
http://groups.google.com/group/django-updates?hl=en.