Everyone, thanks for all the help!  I came up with this validator:

class DateCompare(validators.FancyValidator):

    """
    Make sure that the stop time comes after the start time.
    """

    messages = dict(
        invalid = "The start date needs to be before the stop date"
    )

    def validate_python(self, field_dict, state):

        log.debug("locals inside validate_python: %s" % locals())

        start_date = field_dict['start_date']
        stop_date = field_dict['stop_date']

        if start_date >= stop_date:
            msg = self.message('invalid', state)

            raise validators.Invalid(msg, field_dict, state,
                error_dict=dict(stop_date=msg))


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to