On Mon, 2009-05-18 at 01:03 -0700, Christian Martín Reinhold wrote:
> Hello I am kind of new with django and I am trying to adapt a piece of
> code to the 1.0 version.
>
> datetime = models.DateTimeField(blank=True, null=True,
> validator_list=[RequiredIfOtherFieldEquals('status', '2',("A
> datetime "
> "must be specified if status is 'Closed
> Before'.")),
> RequiredIfOtherFieldEquals('status', '3',("A
> datetime "
> "must be specified if status is 'Closed
> After'."))],
> help_text=("Required if status is set to 'Closed Before' or
> 'Closed After'."))
>
> The point is I no longuer have django.core.validators in django 1.0 so
> I don't know how to do this. ¿Could anyone give me some hints?
> Thank you.
The reference is here:
http://docs.djangoproject.com/en/1.0/ref/forms/validation/#cleaning-and-validating-fields-that-depend-on-each-other
You'll want to override Form.clean, as shown in the section 'Cleaning
and validating fields that depend on each other'.
sdc
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---