I am using django-solo to create a model which can have only one instance of it type. https://github.com/lazybird/django-solo
I have a model like this
class ProductPropertiesPriority(SingletonModel):
product_type = models.PositiveIntegerField(validators=[
MaxValueValidator(6),
MinValueValidator(1)
],
default=1)
style = models.PositiveIntegerField(validators=[
MaxValueValidator(6),
MinValueValidator(1)
],
default=2)
color = models.PositiveIntegerField(validators=[
MaxValueValidator(6),
MinValueValidator(1)
],
default=3)
series = models.PositiveIntegerField(validators=[
MaxValueValidator(6),
MinValueValidator(1)
],
default=4)
size = models.PositiveIntegerField(validators=[
MaxValueValidator(6),
MinValueValidator(1)
],
default=5)
brand = models.PositiveIntegerField(validators=[
MaxValueValidator(6),
MinValueValidator(1)
],
default=6)
Here I want to set a priority to each field. I want all IntegerField in a single instance to be unique with each other. The value of one field shouldnot match with any other.
How can i solve this. Please help.