Add: meta and str func to UserProfile model

This commit is contained in:
Aroy-Art 2024-06-17 22:37:26 +02:00
parent 787ba6d50f
commit 5296206c42
Signed by: Aroy
GPG key ID: DB9689E9391DD156

View file

@ -4,6 +4,7 @@ from django.contrib.auth.models import User
from django.db.models.signals import post_save
from django.dispatch import receiver
from django.utils.translation import gettext_lazy as _
from sites.furaffinity.models import FA_Submission
@ -18,6 +19,13 @@ class UserProfile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE, primary_key=True, unique=True)
show_mature = models.CharField(max_length=2, choices=MATURE, default=MATURE[0][0])
class Meta:
verbose_name = _("User Profile")
verbose_name_plural = _("User Profiles")
def __str__(self):
return self.user.username
class SeenPost(models.Model):
user = models.ForeignKey(UserProfile, on_delete=models.CASCADE)