(self, value)
return value
Return a validated number or None.
Return a validated number or None.
Return a validated number or None .
def _validate(self, value):
        """Return a validated number or None."""
        if self.lock:
            return None
        try:
            value = self._data['type'](value)
        except ValueError:
            return None
        min_value = self._data.get('min', None)
        if min_value is not None:
            value = max(value, min_value)
        max_value = self._data.get('max', None)
        if max_value is not None:
            value = min(value, max_value)
        return value
def _validate ( self , value ) : if self . lock : return None try : value = self . _data [ 'type' ] ( value ) except ValueError : return None min_value = self . _data . get ( 'min' , None ) if min_value is not None : value = max ( value , min_value ) max_value = self . _data . get ( 'max' , None ) if max_value is not None : value = min ( value , max_value ) return value