Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- full_time_equivalent = models.DecimalField(
- max_digits=5,
- decimal_places=2,
- default=100,
- validators=[
- MinValueValidator(Decimal(0)),
- MaxValueValidator(Decimal(100))
- ]
- )
- def save(self, *args, **kwargs):
- # Run validations
- self.full_clean()
- return super().save(*args, **kwargs)
- project2_membership = ProjectMembership(
- user=self.new_user,
- project=project2,
- is_project_manager=False,
- full_time_equivalent=10.01
- )
- Decimal('10.0099999999999997868371792719699442386627197265625')
- django.core.exceptions.ValidationError:
- {'full_time_equivalent': ['Ensure that there are no more than 5 digits in total.']
Add Comment
Please, Sign In to add comment