Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Ledger(models.Model):
- name = models.CharField(max_length=200)
- account_number = models.CharField(max_length=250,unique=True)
- opening_balance = models.FloatField(default=0.0)
- amount_to_pay = models.OneToOneField('Expense',on_delete=models.CASCADE)
- account_type = models.CharField(max_length=200)
- current_balance = models.FloatField(default=0.0)
- created = models.DateTimeField(auto_now_add=True)
- updated = models.DateTimeField(auto_now=True)
- slug = AutoSlugField(unique_with='id', populate_from='name')
- class Expense(models.Model):
- pay_from = models.CharField(max_length=200)
- payment_option = models.ForeignKey(Ledger, on_delete=models.CASCADE)
- amount_to_pay = models.FloatField(default=0.0)
- expense_date = models.DateField(default=datetime.date.today)
- expense_type = models.ForeignKey(ExpenseType, on_delete=models.CASCADE)
- note = models.TextField()
- created = models.DateTimeField(auto_now_add=True)
- updated = models.DateTimeField(auto_now=True)
- slug = AutoSlugField(unique_with='id', populate_from='expense_type')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement