Spaces:
Runtime error
Runtime error
gamingflexer
commited on
Commit
·
12e3df8
1
Parent(s):
a25b679
Add Product model to API
Browse files- src/app/api/models.py +17 -1
src/app/api/models.py
CHANGED
|
@@ -1,3 +1,19 @@
|
|
| 1 |
from django.db import models
|
| 2 |
|
| 3 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
from django.db import models
|
| 2 |
|
| 3 |
+
class Product(models.Model):
|
| 4 |
+
barcode = models.CharField(max_length=20)
|
| 5 |
+
brand = models.CharField(max_length=100)
|
| 6 |
+
sub_brand = models.CharField(max_length=100, blank=True, null=True)
|
| 7 |
+
manufacturer = models.CharField(max_length=200)
|
| 8 |
+
product_name = models.CharField(max_length=200)
|
| 9 |
+
weight = models.FloatField()
|
| 10 |
+
variant = models.CharField(max_length=100, blank=True, null=True)
|
| 11 |
+
net_content = models.CharField(max_length=100, blank=True, null=True)
|
| 12 |
+
price = models.DecimalField(max_digits=10, decimal_places=2)
|
| 13 |
+
parent_category = models.CharField(max_length=100)
|
| 14 |
+
child_category = models.CharField(max_length=100)
|
| 15 |
+
sub_child_category = models.CharField(max_length=100, blank=True, null=True)
|
| 16 |
+
images_paths = models.CharField(max_length=3000, blank=True, null=True) # Comma separated paths
|
| 17 |
+
|
| 18 |
+
def __str__(self):
|
| 19 |
+
return self.product_name
|