Add: CreatorModel to archive app
This commit is contained in:
parent
3aba2cb23a
commit
9c4ef5466e
1 changed files with 39 additions and 0 deletions
|
@ -63,6 +63,45 @@ class CreatorDescription(models.Model):
|
||||||
date_imported = models.DateTimeField(auto_now_add=True)
|
date_imported = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
|
|
||||||
|
class CreatorModel(models.Model):
|
||||||
|
creator_id = models.CharField(max_length=128, null=True)
|
||||||
|
source_site = models.ForeignKey(
|
||||||
|
to=SourceSiteModel, on_delete=models.CASCADE, related_name="creators"
|
||||||
|
)
|
||||||
|
slug = models.CharField(max_length=64)
|
||||||
|
name = models.CharField(max_length=64)
|
||||||
|
description = models.ManyToManyField(
|
||||||
|
to=DescriptionModel, related_name="creators", through=CreatorDescription
|
||||||
|
)
|
||||||
|
avatar = models.ForeignKey(
|
||||||
|
to=PostFileModel,
|
||||||
|
on_delete=models.SET_NULL,
|
||||||
|
null=True,
|
||||||
|
blank=True,
|
||||||
|
related_name="creators_avatar",
|
||||||
|
)
|
||||||
|
banner = models.ForeignKey(
|
||||||
|
to=PostFileModel,
|
||||||
|
on_delete=models.SET_NULL,
|
||||||
|
null=True,
|
||||||
|
blank=True,
|
||||||
|
related_name="creators_banner",
|
||||||
|
)
|
||||||
|
categories = models.ManyToManyField(to=CategoryModel, related_name="creators")
|
||||||
|
date_created = models.DateTimeField(auto_now_add=True, editable=True)
|
||||||
|
date_last_import = models.DateTimeField(auto_now=True, editable=True)
|
||||||
|
date_imported = models.DateTimeField(auto_now_add=True, editable=True)
|
||||||
|
|
||||||
|
mature = models.BooleanField(default=False)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
verbose_name = "Creator"
|
||||||
|
verbose_name_plural = "Creators"
|
||||||
|
|
||||||
|
def __str__(self):
|
||||||
|
return str(self.name)
|
||||||
|
|
||||||
|
|
||||||
class PostModel(models.Model):
|
class PostModel(models.Model):
|
||||||
post_id = models.CharField(max_length=128, db_index=True)
|
post_id = models.CharField(max_length=128, db_index=True)
|
||||||
title = models.CharField(max_length=64)
|
title = models.CharField(max_length=64)
|
||||||
|
|
Loading…
Add table
Reference in a new issue