model changes

This commit is contained in:
2024-03-03 11:57:08 +03:00
parent 84faba9759
commit 5f80979aa2
6 changed files with 62 additions and 78 deletions
-19
View File
@@ -1,23 +1,6 @@
from django.db import models
class Brand(models.Model):
name = models.CharField(max_length=100)
description = models.TextField(blank=True)
def __str__(self):
return f"{self.name}"
class Supplier(models.Model):
name = models.CharField(max_length=100)
email = models.EmailField()
phone = models.CharField(max_length=20)
def __str__(self):
return f"{self.name}"
class Product(models.Model):
name = models.CharField(max_length=100)
description = models.TextField()
@@ -25,8 +8,6 @@ class Product(models.Model):
price = models.DecimalField(max_digits=10, decimal_places=2)
quantity = models.IntegerField(default=0)
barcode = models.CharField(max_length=100, blank=True, null=True)
brand = models.ForeignKey(Brand, models.DO_NOTHING)
supplier = models.ForeignKey(Supplier, models.DO_NOTHING)
def __str__(self):
return f"{self.name}"