intro_Django/TiendaOnline/gestionPedidos/models.py

26 lines
764 B
Python
Raw Normal View History

2020-11-13 01:14:23 -03:00
from django.db import models
class Clientes(models.Model):
2020-11-15 02:19:35 -03:00
nombre = models.CharField(max_length = 30)
direccion = models.CharField(max_length = 50, verbose_name = "La Direcc.:")
email = models.EmailField(blank = True, null = True)
fono = models.CharField(max_length = 10)
def __str__(self):
return (self.nombre)
2020-11-13 01:14:23 -03:00
class Articulos(models.Model):
2020-11-15 02:19:35 -03:00
nombre = models.CharField(max_length = 30)
seccion = models.CharField(max_length = 20)
2020-11-13 01:14:23 -03:00
precio = models.IntegerField()
2020-11-13 01:18:02 -03:00
def __str__(self):
return 'Nombre: %s, Depto. %s, Precio $ %s' % (self.nombre, self.seccion, self.precio)
2020-11-13 01:14:23 -03:00
2020-11-15 02:19:35 -03:00
2020-11-13 01:14:23 -03:00
class Pedidos (models.Model):
numero = models.IntegerField()
fecha = models.DateField()
2020-11-15 02:19:35 -03:00
entregado = models.BooleanField()