def parse(self, elt, ps): val = Decimal.parse(self, elt, ps) if val not in self.choices: raise EvaluateException('Value "' + str(val) + \ '" not in enumeration list', ps.Backtrace(elt)) return val
def serialize(self, elt, sw, pyobj, name=None, orig=None, **kw): if pyobj not in self.choices: raise EvaluateException('Value not in int enumeration list', ps.Backtrace(elt)) Decimal.serialize(self, elt, sw, pyobj, name=name, orig=orig, **kw)