Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.08 KB | None | 0 0
  1. class Ledger(models.Model):
  2. name = models.CharField(max_length=200)
  3. account_number = models.CharField(max_length=250,unique=True)
  4. opening_balance = models.FloatField(default=0.0)
  5. amount_to_pay = models.OneToOneField('Expense',on_delete=models.CASCADE)
  6. account_type = models.CharField(max_length=200)
  7. current_balance = models.FloatField(default=0.0)
  8. created = models.DateTimeField(auto_now_add=True)
  9. updated = models.DateTimeField(auto_now=True)
  10. slug = AutoSlugField(unique_with='id', populate_from='name')
  11.  
  12.  
  13. class Expense(models.Model):
  14. pay_from = models.CharField(max_length=200)
  15. payment_option = models.ForeignKey(Ledger, on_delete=models.CASCADE)
  16. amount_to_pay = models.FloatField(default=0.0)
  17. expense_date = models.DateField(default=datetime.date.today)
  18. expense_type = models.ForeignKey(ExpenseType, on_delete=models.CASCADE)
  19. note = models.TextField()
  20. created = models.DateTimeField(auto_now_add=True)
  21. updated = models.DateTimeField(auto_now=True)
  22. slug = AutoSlugField(unique_with='id', populate_from='expense_type')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement