def parse_date(self, value):
        """
        A lazy method to parse anything to date.

        If input data type is:

        - string: parse date from it
        - integer: use from ordinal
        - datetime: use date part
        - date: just return it
        """
        if isinstance(value, sixmini.string_types):
            return self.str2date(value)
        elif value is None:
            raise TypeError("Unable to parse date from %r" % value)
        elif isinstance(value, sixmini.integer_types):
            return date.fromordinal(value)
        elif isinstance(value, datetime):
            return value.date()
        elif isinstance(value, date):
            return value
        else:
            raise ValueError("Unable to parse date from %r" % value)
def parse_date ( self , value ) : if isinstance ( value , sixmini . string_types ) : return self . str2date ( value ) elif value is None : raise TypeError ( "Unable to parse date from %r" % value ) elif isinstance ( value , sixmini . integer_types ) : return date . fromordinal ( value ) elif isinstance ( value , datetime ) : return value . date ( ) elif isinstance ( value , date ) : return value else : raise ValueError ( "Unable to parse date from %r" % value )
A lazy method to parse anything to date.

        If input data type is:

        - string: parse date from it
        - integer: use from ordinal
        - datetime: use date part
        - date: just return it