elvandry13's picture
Clean repository history
c2eae0d
Raw History Blame Contribute Delete
411 Bytes
from django.db import models
class Balance(models.Model):
user = models.OneToOneField(
'users.User',
on_delete=models.CASCADE,
related_name="balance"
)
total_balance = models.PositiveIntegerField(
default=0
)
updated_at = models.DateTimeField(
auto_now=True
)
def __str__(self):
return f"{self.user.email} - {self.total_balance}"