I would like to ask, if it's possible to limit one IntegerField inside my model-class in comparison to another one!? For example:
models.py
class Example(models.Model):
name = models.CharField(max_length=50, null=False, blank=False, unique=True)
ports = models.IntegerField(default=1, validators=[MinValueValidator(1), MaxValueValidator(50)])
ports_active = models.IntegerField(default=0, validators=[MinValueValidator(0), MaxValueValidator(50)])
As you may see, the ports_active are related to ports!? Is it possible to limit the ports_active-field, so that it can only be less or equal, but never greater than ports?
Thanks for your help and have a great day!