def parse ( self , s ) : return datetime . datetime . strptime ( s , self . date_format ) . date ( )
python validate string as date
Parses a date string formatted like YYYY - MM - DD .
def parse(self, s):
        """
        Parses a date string formatted like ``YYYY-MM-DD``.
        """
        return datetime.datetime.strptime(s, self.date_format).date()