I have a django model called Product. I wish to have a set of values. Specifically, each product will have different sizes (say 500 mg, 1 g, bulk order; the specific sizes will be differ for each product), along with it, I should have corresponding cost. For example,
- 1g - $500;
- 5g - $1500;
- bulk order -ask for quote;
For another product, this could be:
- 100ml - $100;
- 200ml -$170;
- 1L -$1000;
I could use something like:
size1 = models.CharField(max_length=200)
price1 = models.DecimalField
size2 = models.CharField(max_length=200)
price2 = models.DecimalField
size3 = models.CharField(max_length=200)
price3 = models.DecimalField
Is there a better way of achieving this? Is there something like sets field? Thanks!