Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Variants(models.Model):
- prod_id = models.ForeignKey(Products, on_delete=models.CASCADE)
- size_id = models.ForeignKey(Size, null=True, on_delete=models.SET_NULL)
- quantity = models.IntegerField()
- price =models.IntegerField()
- color_id = models.ForeignKey(Color, null=True, on_delete=models.SET_NULL, default='')
- image = models.ManyToManyField(Image)
- createdAt = models.DateField(auto_now_add=True)
- barcode = models.CharField(max_length=200, default='no barcode')
- class Products(models.Model):
- barcode = models.CharField(max_length=200, default='no barcode')
- prod_name = models.CharField(max_length=200)
- category = models.ForeignKey(Categories,null=True, on_delete=models.SET_NULL)
- brand = models.CharField(max_length=200, null=True)
- description = models.TextField(default='no description provided.')
- class Categories(models.Model):
- category_name = models.CharField(max_length=200)
- class Size(models.Model):
- name = models.CharField(max_length=200)
- class Color(models.Model):
- name = models.CharField(max_length=200)
- class Image(models.Model):
- prod_image = models.ImageField(upload_to=upload_to, default='')
- image_url = models.URLField(null=True)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement