be fe fixes
This commit is contained in:
@@ -22,15 +22,30 @@ class Tasks(SiteSectorBaseModel):
|
||||
limit_choices_to={'sector': models.F('sector')},
|
||||
help_text="Parent cluster (required)"
|
||||
)
|
||||
idea = models.ForeignKey(
|
||||
'planner.ContentIdeas',
|
||||
on_delete=models.SET_NULL,
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name='tasks',
|
||||
help_text="Optional content idea reference",
|
||||
db_column='idea_id'
|
||||
)
|
||||
content_type = models.CharField(
|
||||
max_length=100,
|
||||
db_index=True,
|
||||
help_text="Content type: post, page, product, service, category, tag, etc."
|
||||
help_text="Content type: post, page, product, service, category, tag, etc.",
|
||||
db_column='entity_type',
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
content_structure = models.CharField(
|
||||
max_length=100,
|
||||
db_index=True,
|
||||
help_text="Content structure/format: article, listicle, guide, comparison, product_page, etc."
|
||||
help_text="Content structure/format: article, listicle, guide, comparison, product_page, etc.",
|
||||
db_column='cluster_role',
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
taxonomy_term = models.ForeignKey(
|
||||
'ContentTaxonomy',
|
||||
@@ -38,13 +53,13 @@ class Tasks(SiteSectorBaseModel):
|
||||
null=True,
|
||||
blank=True,
|
||||
related_name='tasks',
|
||||
help_text="Optional taxonomy term assignment"
|
||||
help_text="Optional taxonomy term assignment",
|
||||
db_column='taxonomy_id'
|
||||
)
|
||||
keywords = models.ManyToManyField(
|
||||
'planner.Keywords',
|
||||
keywords = models.TextField(
|
||||
blank=True,
|
||||
related_name='tasks',
|
||||
help_text="Keywords linked to this task"
|
||||
null=True,
|
||||
help_text="Comma-separated keywords for this task"
|
||||
)
|
||||
status = models.CharField(max_length=50, choices=STATUS_CHOICES, default='queued')
|
||||
|
||||
@@ -70,6 +85,19 @@ class Tasks(SiteSectorBaseModel):
|
||||
return self.title
|
||||
|
||||
|
||||
class ContentTaxonomyRelation(models.Model):
|
||||
"""Through model for Content-Taxonomy many-to-many relationship"""
|
||||
content = models.ForeignKey('Content', on_delete=models.CASCADE, db_column='content_id')
|
||||
taxonomy = models.ForeignKey('ContentTaxonomy', on_delete=models.CASCADE, db_column='taxonomy_id')
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
updated_at = models.DateTimeField(auto_now=True)
|
||||
|
||||
class Meta:
|
||||
app_label = 'writer'
|
||||
db_table = 'igny8_content_taxonomy_relations'
|
||||
unique_together = [['content', 'taxonomy']]
|
||||
|
||||
|
||||
class Content(SiteSectorBaseModel):
|
||||
"""
|
||||
Content model for AI-generated or WordPress-imported content.
|
||||
@@ -78,7 +106,7 @@ class Content(SiteSectorBaseModel):
|
||||
|
||||
# Core content fields
|
||||
title = models.CharField(max_length=255, db_index=True)
|
||||
content_html = models.TextField(help_text="Final HTML content")
|
||||
content_html = models.TextField(help_text="Final HTML content", db_column='html_content')
|
||||
cluster = models.ForeignKey(
|
||||
'planner.Clusters',
|
||||
on_delete=models.SET_NULL,
|
||||
@@ -90,26 +118,34 @@ class Content(SiteSectorBaseModel):
|
||||
content_type = models.CharField(
|
||||
max_length=100,
|
||||
db_index=True,
|
||||
help_text="Content type: post, page, product, service, category, tag, etc."
|
||||
help_text="Content type: post, page, product, service, category, tag, etc.",
|
||||
db_column='entity_type',
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
content_structure = models.CharField(
|
||||
max_length=100,
|
||||
db_index=True,
|
||||
help_text="Content structure/format: article, listicle, guide, comparison, product_page, etc."
|
||||
help_text="Content structure/format: article, listicle, guide, comparison, product_page, etc.",
|
||||
db_column='cluster_role',
|
||||
blank=True,
|
||||
null=True
|
||||
)
|
||||
|
||||
# Taxonomy relationships
|
||||
taxonomy_terms = models.ManyToManyField(
|
||||
'ContentTaxonomy',
|
||||
through='ContentTaxonomyRelation',
|
||||
blank=True,
|
||||
related_name='contents',
|
||||
db_table='igny8_content_taxonomy_relations',
|
||||
help_text="Associated taxonomy terms (categories, tags, attributes)"
|
||||
)
|
||||
|
||||
# External platform fields (WordPress integration)
|
||||
external_id = models.CharField(max_length=255, blank=True, null=True, db_index=True, help_text="WordPress/external platform post ID")
|
||||
external_url = models.URLField(blank=True, null=True, help_text="WordPress/external platform URL")
|
||||
external_type = models.CharField(max_length=100, blank=True, null=True, help_text="WordPress post type (post, page, product, etc.)")
|
||||
sync_status = models.CharField(max_length=50, blank=True, null=True, help_text="Sync status with WordPress")
|
||||
|
||||
# Source tracking
|
||||
SOURCE_CHOICES = [
|
||||
|
||||
Reference in New Issue
Block a user