我们从Python开源项目中,提取了以下28个代码示例,用于说明如何使用django.core.validators.DecimalValidator()。
def __init__(self, max_value=None, min_value=None, max_digits=None, decimal_places=None, *args, **kwargs): self.max_digits, self.decimal_places = max_digits, decimal_places super(DecimalField, self).__init__(max_value, min_value, *args, **kwargs) self.validators.append(validators.DecimalValidator(max_digits, decimal_places))
def validators(self): return super(DecimalField, self).validators + [ validators.DecimalValidator(self.max_digits, self.decimal_places) ]