def valid(self):
    if (not self.value):
        return True
    try:
        datetime.datetime.strptime(self.value, '%Y-%m-%d')
        return True
    except ValueError:
        return traceback.format_exc().splitlines()[(- 1)]
def valid(self):
    if (not self.value):
        return True
    try:
        datetime.datetime.strptime(self.value, '%Y-%m-%d')
        return True
    except ValueError:
        return traceback.format_exc().splitlines()[(- 1)]