mirror of
https://github.com/andwati/store-api.git
synced 2026-11-30 20:28:47 +00:00
completed products views
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
from django.contrib.auth.models import User
|
||||
from django.db import models
|
||||
|
||||
|
||||
@@ -8,6 +9,7 @@ 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)
|
||||
owner = models.ForeignKey(User, on_delete=models.CASCADE)
|
||||
|
||||
def __str__(self):
|
||||
return f"{self.name}"
|
||||
|
||||
Reference in New Issue
Block a user