How Do I Make An "order" Products App Like This
My name is Federico I need to make a system for my company, we sell perfumes, in a first stage I only need an app where people can choose between 5 perfumes types, when they chose
Solution 1:
Looks like you've almost got it :)
The approach I would use would be:
classAroma(models.Model):
nombre = models.CharField(max_length=30)
classLineaProducto(models.Model):
nombre = models.CharField(max_length=40)
classTipoProducto(models.Model):
nombre = models.CharField(max_length=20)
linea_producto = models.ForeignKey(LineaProducto, on_delete=models.CASCADE)
classProducto(models.Model):
nombre = models.CharField(max_length=20)
aromas = models.ManyToManyField(Aroma)
tipo_producto = models.ForeignKey(TipoProducto, on_delete=models.CASCADE)
precio_mayorista = models.IntegerField(default=0)
precio_final = models.IntegerField(default=0)
The LineaProducto would be the "Type", The TipoProducto would be the "Family" and the Producto would be the product.
Hopefully this sets you in the right direction!
Post a Comment for "How Do I Make An "order" Products App Like This"