Add: meta and str func to UserProfile model
This commit is contained in:
parent
787ba6d50f
commit
5296206c42
1 changed files with 8 additions and 0 deletions
|
@ -4,6 +4,7 @@ from django.contrib.auth.models import User
|
||||||
from django.db.models.signals import post_save
|
from django.db.models.signals import post_save
|
||||||
from django.dispatch import receiver
|
from django.dispatch import receiver
|
||||||
|
|
||||||
|
from django.utils.translation import gettext_lazy as _
|
||||||
|
|
||||||
from sites.furaffinity.models import FA_Submission
|
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)
|
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])
|
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):
|
class SeenPost(models.Model):
|
||||||
user = models.ForeignKey(UserProfile, on_delete=models.CASCADE)
|
user = models.ForeignKey(UserProfile, on_delete=models.CASCADE)
|
||||||
|
|
Loading…
Reference in a new issue