13 lines
No EOL
484 B
Python
13 lines
No EOL
484 B
Python
from django.db import models
|
|
from django.conf import settings
|
|
from accounts.models import CustomUser
|
|
|
|
class FriendCode(models.Model):
|
|
id = models.AutoField(primary_key=True)
|
|
friend_code = models.CharField(max_length=19)
|
|
user = models.ForeignKey("accounts.CustomUser", on_delete=models.PROTECT, related_name='friend_codes')
|
|
created_at = models.DateTimeField(auto_now_add=True)
|
|
updated_at = models.DateTimeField(auto_now=True)
|
|
|
|
def __str__(self):
|
|
return self.friend_code |