mirror of
				https://github.com/django/django.git
				synced 2025-10-31 09:41:08 +00:00 
			
		
		
		
	Fixed #24636 -- Added model field validation for decimal places and max digits.
This commit is contained in:
		
				
					committed by
					
						 Simon Charette
						Simon Charette
					
				
			
			
				
	
			
			
			
						parent
						
							6f1b09bb5c
						
					
				
				
					commit
					75ed590032
				
			| @@ -1578,6 +1578,12 @@ class DecimalField(Field): | ||||
|             ] | ||||
|         return [] | ||||
|  | ||||
|     @cached_property | ||||
|     def validators(self): | ||||
|         return super(DecimalField, self).validators + [ | ||||
|             validators.DecimalValidator(self.max_digits, self.decimal_places) | ||||
|         ] | ||||
|  | ||||
|     def deconstruct(self): | ||||
|         name, path, args, kwargs = super(DecimalField, self).deconstruct() | ||||
|         if self.max_digits is not None: | ||||
|   | ||||
		Reference in New Issue
	
	Block a user