In my models I’ve some FloatFields that must be > 0. I’m wondering what is the best way to check, at the model level (not form), that the values for these Fields are greater than 0? Browsing the documentation I’ve found the following three methods:
- Add the MinValueValidator to each field.
- Check them in the model.clean() method
- Create a custom field that accept only floats > 0.
And, if a choose the custom field, which FloatField’s method do I need to override to check that the value is > 0?
Best regards,
e.p.
No comments:
Post a Comment