Trying JSON in Django and PostgreSQL (and compare with MongoDB)
class Product(models.Model): name = models.CharField(max_length=100) category = models.ForeignKey(Category) price = models.IntegerField() attributes = JSONField() def __str__(self): return self.name
Product.objects.create(name='Bamboo tshirt', category=tshirt, price=120, attributes={ 'colors': ['white', 'yellow'], 'sizes': ['M', 'L', 'XL'], 'model': 'poet', 'material': 'bamboo', })