Exemple #1
0
class Pedidos(models.Model):
    fecha = models.DateTimeField(auto_now_add=True)
    modo_pago = models.CharField(max_length=50)
    para_llevar = models.CharField(max_length=50)
    num_avisador = models.CharField(max_length=50)
    direccion = models.CharField(max_length=150,
                                 default="No hay direccion",
                                 null=True)
    total = models.DecimalField(max_digits=20,
                                decimal_places=2,
                                null=True,
                                default=0.0)
    estado = models.CharField(max_length=10, default="PG_NO")
    entrega = models.DecimalField(max_digits=20,
                                  decimal_places=2,
                                  null=True,
                                  default=0.0)
    cambio = models.DecimalField(max_digits=20,
                                 decimal_places=2,
                                 null=True,
                                 default=0.0)
    modify = models.DateTimeField(auto_now=True)
    servido = models.BooleanField(default=False)

    def __unicode__(self):
        return u"{0} - {1} - {2}".format(self.id, self.estado, self.total)

    class Meta:
        verbose_name = "Pedido"
Exemple #2
0
class LineasPedido(models.Model):
    text = models.CharField(max_length=50)
    des = models.TextField(null=True)
    cant = models.IntegerField()
    precio = models.DecimalField(max_digits=20, decimal_places=2)
    total = models.DecimalField(max_digits=20, decimal_places=2)
    tipo = models.CharField(max_length=50)
    pedidos = models.ForeignKey(Pedidos, on_delete=models.CASCADE)
    modify = models.DateTimeField(auto_now=True)
Exemple #3
0
class Clientes(models.Model):
    nombre = models.CharField(max_length=50)
    apellido = models.CharField(max_length=100, null=True)
    email = models.EmailField(max_length=100, null=True, blank=True)
    telefono = models.CharField(max_length=20)
    nota = models.TextField(null=True)
    pedidos = models.ManyToManyField(Pedidos)
    fecha_add = models.DateField(auto_now_add=True)
    modify = models.DateTimeField(auto_now=True)
    direccion = models.IntegerField(null=True)
Exemple #4
0
class Pedidos(models.Model):
    fecha = models.DateTimeField(auto_now_add=True)
    modo_pago = models.CharField(max_length=50)
    para_llevar = models.CharField(max_length=50)
    num_avisador = models.CharField(max_length=50)
    total = models.DecimalField(max_digits=20, decimal_places=2)
    estado = models.CharField(max_length=10, default="PG_NO")
    entrega = models.DecimalField(max_digits=20, decimal_places=2)
    cambio = models.DecimalField(max_digits=20, decimal_places=2)
    modify = models.DateTimeField(auto_now=True)
Exemple #5
0
class TestFields(models.Model):
    char = models.CharField(max_length=100)
    text = models.TextField()
    date = models.DateField(auto_now_add=True)
    date_time = models.DateTimeField(auto_now=True)
    boolean = models.BooleanField()
    integer = models.IntegerField()
    decimal = models.DecimalField(5, 2)
Exemple #6
0
class Publication(models.Model):
    title = models.CharField(max_length=30)

    class Meta:
        ordering = ['title']

    def __str__(self):
        return self.title
Exemple #7
0
class Article(models.Model):
    headline = models.CharField(max_length=100)
    publications = models.ManyToManyField(Publication)

    class Meta:
        ordering = ['headline']

    def __str__(self):
        return self.headline
Exemple #8
0
class LineasPedido(models.Model):
    text = models.CharField(max_length=50)
    des = models.TextField(null=True)
    cant = models.IntegerField()
    precio = models.DecimalField(max_digits=20,
                                 decimal_places=2,
                                 null=True,
                                 default=0.0)
    total = models.DecimalField(max_digits=20,
                                decimal_places=2,
                                null=True,
                                default=0.0)
    tipo = models.CharField(max_length=50)
    pedidos = models.ForeignKey(Pedidos, on_delete=models.CASCADE)
    modify = models.DateTimeField(auto_now=True)
    servido = models.BooleanField(default=False)
    imprimible = models.BooleanField(default=False)

    def __unicode__(self):
        return u"{0} - {1} - {2} - {3}".format(self.cant, self.text,
                                               self.precio, self.total)
Exemple #9
0
class PedidosExtra(models.Model):
    importe = models.DecimalField(max_digits=20, decimal_places=2)
    numero_pedido =  models.IntegerField()
    modo_pago =  models.CharField(max_length=50, null=True, blank=True, default="Efectivo")
    modify = models.DateTimeField(auto_now=True)
    estado =  models.CharField(max_length=50, null=True, blank=True, default="no_arqueado")
Exemple #10
0
class Conteo(models.Model):
    can = models.IntegerField()
    tipo =  models.DecimalField(max_digits=20, decimal_places=2)
    total =  models.DecimalField(max_digits=20, decimal_places=2)
    texto_tipo = models.CharField(max_length=100, null=True, blank=True)
    modify = models.DateTimeField(auto_now=True)
Exemple #11
0
class Gastos(models.Model):
    des = models.CharField(max_length=100)
    gasto = models.DecimalField(max_digits=20, decimal_places=2)
    modify = models.DateTimeField(auto_now=True)
Exemple #12
0
class Album(models.Model):
    artist = models.ForeignKey(Musician, on_delete=models.CASCADE)
    name = models.CharField(max_length=100)
    release_date = models.DateField()
    num_stars = models.IntegerField()
Exemple #13
0
class Musician(models.Model):
    first_name = models.CharField(max_length=50)
    last_name = models.CharField(max_length=50)
    instrument = models.CharField(max_length=100)
Exemple #14
0
class Person(models.Model):
    first_name = models.CharField(max_length=30)
    last_name = models.CharField(max_length=30)
    casado = models.BooleanField()
Exemple #15
0
class TestNullFields(models.Model):
    char_can_null = models.CharField(max_length=20, null=True)
    char__default_not_null = models.CharField(max_length=12,
                                              default="caracola")
Exemple #16
0
class Direcciones(models.Model):
    direccion = models.CharField(max_length=150)
    localidad = models.CharField(max_length=50, default="Grandada", null=True)
    codigo = models.CharField(max_length=10, null=True)
    clientes = models.ForeignKey(Clientes, on_delete=models.CASCADE)
    modify = models.DateTimeField(auto_now=True)