I think this is just a design issue. Why do you put two fields with the same information, since the user has an account with receiveaddress , adding the user as a foreign key will be more and more clean, I suggest the following:
class Account(models.Model): username = models.OneToOneField(User, primary_key=True, unique=True) receiveaddress = models.CharField(max_length=40, blank=True, null=True, unique=True) balance = models.DecimalField(max_digits=16, decimal_places=8, default=0) def __str__(self): return str(self.username) class Deposit(models.Model): amount = models.DecimalField(max_digits=16, decimal_places=8, default=0) user = models.ForeignKey(User, related_name="deposits") created_at = models.DateTimeField(auto_now_add=True) updated_at = models.DateTimeField(auto_now=True) confirmed = models.BooleanField(default=False) accounted = models.BooleanField(default=False) def __str__(self): return str(self.user.account.receiveaddress)
NB: as a symbol, the model name must always be singular
source share