many fixes of backeend and fronteend
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
from django.db import models
|
||||
from django.core.validators import MinValueValidator
|
||||
from igny8_core.auth.models import SiteSectorBaseModel
|
||||
from igny8_core.common.soft_delete import SoftDeletableModel, SoftDeleteManager
|
||||
|
||||
|
||||
class Tasks(SiteSectorBaseModel):
|
||||
class Tasks(SoftDeletableModel, SiteSectorBaseModel):
|
||||
"""Tasks model for content generation queue"""
|
||||
|
||||
STATUS_CHOICES = [
|
||||
@@ -116,6 +117,9 @@ class Tasks(SiteSectorBaseModel):
|
||||
models.Index(fields=['site', 'sector']),
|
||||
]
|
||||
|
||||
objects = SoftDeleteManager()
|
||||
all_objects = models.Manager()
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
@@ -133,7 +137,7 @@ class ContentTaxonomyRelation(models.Model):
|
||||
unique_together = [['content', 'taxonomy']]
|
||||
|
||||
|
||||
class Content(SiteSectorBaseModel):
|
||||
class Content(SoftDeletableModel, SiteSectorBaseModel):
|
||||
"""
|
||||
Content model for AI-generated or WordPress-imported content.
|
||||
Final architecture: simplified content management.
|
||||
@@ -267,6 +271,9 @@ class Content(SiteSectorBaseModel):
|
||||
models.Index(fields=['site', 'sector']),
|
||||
]
|
||||
|
||||
objects = SoftDeleteManager()
|
||||
all_objects = models.Manager()
|
||||
|
||||
def __str__(self):
|
||||
return self.title or f"Content {self.id}"
|
||||
|
||||
@@ -350,7 +357,7 @@ class ContentTaxonomy(SiteSectorBaseModel):
|
||||
return f"{self.name} ({self.get_taxonomy_type_display()})"
|
||||
|
||||
|
||||
class Images(SiteSectorBaseModel):
|
||||
class Images(SoftDeletableModel, SiteSectorBaseModel):
|
||||
"""Images model for content-related images (featured, desktop, mobile, in-article)"""
|
||||
|
||||
IMAGE_TYPE_CHOICES = [
|
||||
@@ -399,6 +406,9 @@ class Images(SiteSectorBaseModel):
|
||||
models.Index(fields=['task', 'position']),
|
||||
]
|
||||
|
||||
objects = SoftDeleteManager()
|
||||
all_objects = models.Manager()
|
||||
|
||||
def save(self, *args, **kwargs):
|
||||
"""Automatically set account, site, and sector from content or task"""
|
||||
# Prefer content over task
|
||||
|
||||
Reference in New Issue
Block a user