from django.db import models class Account(models.Model): question_text = models.CharField(max_length=200) created_date = models.DateTimeField('date created') class AccountItem(models.Model): account = models.ForeignKey(Account, on_delete=models.CASCADE, related_name='items') collected=models.DecimalField(max_digits=10, decimal_places=3) paid=models.DecimalField(max_digits=10, decimal_places=3) from_to= models.ForeignKey(Account, on_delete=models.CASCADE, blank=True, related_name='connected_items') description = models.CharField(max_length=100, blank=True) when = models.DateTimeField('date and time created')