def _check_value(self):
     match = False
     if self.measure == 'time':
         match = time_value_pattern.match(self.value)
     else:
         match = number_value_pattern.match(self.value)
     if not match:
         raise ValidationError('Value is not valid')
Ejemplo n.º 2
0
 def _check_value(self):
     if self.value:
         match = False
         if self.measure == 'time':
             match = time_value_pattern.match(self.value)
         else:
             match = number_value_pattern.match(self.value)
         if not match:
             raise ValidationError('Valor con error')
 def _check_push_ups(self):
     for record in self:
         if record.push_ups:
            match = number_value_pattern.match(self.push_ups)
         if not match:
             record.push_ups = 'error!'
 def _check_abdominal(self):
     for record in self:
         if record.abdominal:
             match = number_value_pattern.match(record.abdominal)
             if not match:
                 record.abdominal = 'error!'
Ejemplo n.º 5
0
 def _check_push_ups(self):
     match = number_value_pattern.match(self.push_ups)
     if not match:
         self.push_ups = 'error!'
Ejemplo n.º 6
0
 def _check_abdominal(self):
     match = number_value_pattern.match(self.abdominal)
     if not match:
         self.abdominal = 'error!'