Exemple #1
0
 def decode(self, value):
     try:
         return float(value)
     except ValueError:
         raise InvalidDecodeValueError(value)
Exemple #2
0
 def decode(self, value):
     if self.is_valid(value):
         return value
     else:
         raise InvalidDecodeValueError(value)
Exemple #3
0
 def decode(self, value):
     choice = super(ChoiceOption, self).decode(value)
     if choice in self.choices:
         return choice
     else:
         raise InvalidDecodeValueError(value)