In MongoDB, I can do the following to represent infinity:
db.foo.insert({'max': Number.POSITIVE_INFINITY});
How can I store Infinity in a Document defined like this:
class Foo(Document):
min = DecimalField()
max = DecimalField()
price = DecimalField()
The following fails:
foo = Foo(min=100, max=float("inf"))
With:
InvalidOperation: quantize with one INF
@BlakesSeven recommended the FloatField
instead, which I verified that it works. However, I'm using this field for financial purposes, so I'm not sure how safe it is.