Add sites Users model

This commit is contained in:
Aroy-Art 2024-12-30 23:09:05 +01:00
parent 973e23815b
commit 6f042c3669
Signed by: Aroy
GPG key ID: 583642324A1D2070

View file

@ -35,4 +35,25 @@ class Tags(models.Model):
def __str__(self): def __str__(self):
return self.tag_slug return self.tag_slug
class Users(models.Model):
user_hash = models.CharField(unique=True, max_length=64,)
date_added = models.DateTimeField(auto_now_add=True, editable=True)
category = models.ForeignKey(Category, on_delete=models.CASCADE, null=True)
content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, null=True) content_type = models.ForeignKey(ContentType, on_delete=models.CASCADE, null=True)
object_id = models.PositiveBigIntegerField(null=True)
content_object = GenericForeignKey('content_type', 'object_id')
class Meta:
verbose_name = _("user")
verbose_name_plural = _("Users")
def __str__(self):
return self.content_object.artist
def get_absolute_url(self):
return reverse('sites:artist_profile', args=[self.user_hash])