3

I'm a newbie Python developer. I have a class that defines a DecimalNode in my Python code as such:

class DecimalNode(colander.SchemaNode):
schema_type = colander.Decimal
validator = colander.Range(0, 100)

But I need to make sure that there is a maximum number of decimals (in my case it's 2, for example, 99.99 and no it is not a money field but a percentage).

How do I define this in colander. I looked at the colander docs but it is not clear.

Ray
  • 4,679
  • 10
  • 46
  • 92

0 Answers0