Hello, I have noticed that the field DateField in the newforms library
doesn't validate all right when introducing data.
I have this code:
FormClass = forms.models.form_for_model(Model)
form = FormClass(data)
data = request.POST.copy()
data['author'] = request.user
formulario = FormClass(data)
if form.is_valid():
form.save()
And I get a validation error, meanwhile, when I validate using the
shell with the following code, it's ok:
>>> f2 = forms.DateField(input_formats=['%d/%m/%Y'])
>>> f2.clean('25/10/2006')
datetime.date(2006, 10, 25)
What's wrong in the first case?
Thank you.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Django users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/django-users?hl=en
-~----------~----~----~----~------~----~------~--~---