Exemple #1
0
def valid_natural_datetime(value):
    output = "relative to now (%s) <pre>   "

    results, errors = zip(*[parse_natural_date(t) for t in value.splitlines()])

    if sum([bool(i) for i in errors if i]):
        raise ValidationError(", ".join([i for i in errors if i]))

    return value
Exemple #2
0
    def eval_natural_date_synax(self):

        timesanderrors = [parse_natural_date(t) for t in self.natural_date_syntax.splitlines()]

        times = [i for i, e in timesanderrors if not e]
        return times