MinValueValidator not working on DecimalField in Django
问题 I have an API developed with Django and Django Rest Framework. I've got a model with a DecimalField which should store values of at least one. Therefore, I've defined the field in the following way: goal = models.DecimalField(decimal_places=2, max_digits=16, validators=[MinValueValidator(1)]) When I create objects calling the API (using DRF's ModelViewSet), I can create objects with negative "goal", so the validator doesn't seem to work (I've got it included in the model serializer). Any idea