You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

16 lines
696 B

from django.db import models
class Tipo(models.Model):
tipo = models.TextField(max_length=10)
class Cuenta(models.Model):
nombre = models.TextField(max_length=20)
saldo_inicial = models.DecimalField(max_digits=10, decimal_places=2)
saldo_actual = models.DecimalField(max_digits=10, decimal_places=2)
tipo = models.ForeignKey(Tipo, on_delete=models.CASCADE)
class Apunte(models.Model):
fecha = models.DateField()
cta_origen = models.ForeignKey(Cuenta, on_delete=models.CASCADE, related_name='origen')
cta_destino = models.ForeignKey(Cuenta, on_delete=models.CASCADE, related_name='destino')
importe = models.DecimalField(max_digits=10, decimal_places=2)