Feat: Se agrega modelo de terceros closed #15

This commit is contained in:
2024-08-03 11:23:33 -05:00
parent e9e64f58db
commit 19a1ba29d7
8 changed files with 96 additions and 16 deletions

View File

@@ -5,6 +5,11 @@ from django.core.exceptions import ValidationError
from decimal import Decimal
class Customer(models.Model):
name = models.CharField(max_length=100)
address = models.CharField(max_length=100)
class MeasuringUnits(models.TextChoices):
UNIT = 'UNIT', _('Unit')
@@ -31,8 +36,7 @@ class Product(models.Model):
class Sale(models.Model):
customer = models.CharField(max_length=100)
customer = models.ForeignKey(Customer, on_delete=models.PROTECT)
date = models.DateField("Date")
phone = models.CharField(max_length=13, null=True, blank=True)
description = models.CharField(max_length=255, null=True, blank=True)