def current_time(form, field): time = function.time_convert(field.data) if function.date_convert(form.date_livre.data) == datetime.date.today(): if function.datetime_convert(date_auto_nows).time() > time: raise wtf.ValidationError( 'l\'heure de livraison doit etre superieur a l\'heure en cours' )
def control_pass_date(form, field): date = function.date_convert(field.data) if datetime.date.today() > date: raise wtf.ValidationError('Appliquez les taux horaires sur une date futur ou actuelle.')
def schedule_activate(form, field): time = function.time_convert(field.data) if function.date_convert(form.departure_date.data) == datetime.date.today(): if function.datetime_convert(date_auto_nows).time() >= time: raise wtf.ValidationError('Time of departure of the current date must be greater than or equal to the current time.')
def departure_date_activate(form, field): date = function.date_convert(field.data) if datetime.date.today() > date: raise wtf.ValidationError('The departure date must be greater than or equal to the current date.')
def current_date(form, field): date = function.date_convert(field.data) if datetime.date.today() > date and not form.update.data: raise wtf.ValidationError( 'La date de livraison doit etre superieur ou egale a la date d\'aujourd\'huit.' )
def current_time(form, field): time = function.time_convert(field.data) if function.date_convert(form.date_livre.data) == datetime.date.today(): if function.datetime_convert(date_auto_nows).time() > time: raise wtf.ValidationError('l\'heure de livraison doit etre superieur a l\'heure en cours')
def current_date(form, field): date = function.date_convert(field.data) if datetime.date.today() > date and not form.update.data: raise wtf.ValidationError('La date de livraison doit etre superieur ou egale a la date d\'aujourd\'huit.')