This commit is contained in:
alorig
2025-11-24 12:55:24 +05:00
parent 2c4cf6a0f5
commit ef735eb70b
6 changed files with 1729 additions and 329 deletions

View File

@@ -3,13 +3,7 @@ from igny8_core.auth.models import SiteSectorBaseModel, SeedKeyword
class Clusters(SiteSectorBaseModel):
"""Clusters model for keyword grouping"""
CONTEXT_TYPE_CHOICES = [
('topic', 'Topic Cluster'),
('attribute', 'Attribute Cluster'),
('service_line', 'Service Line'),
]
"""Clusters model for keyword grouping - pure topic clusters"""
name = models.CharField(max_length=255, unique=True, db_index=True)
description = models.TextField(blank=True, null=True)
@@ -17,17 +11,6 @@ class Clusters(SiteSectorBaseModel):
volume = models.IntegerField(default=0)
mapped_pages = models.IntegerField(default=0)
status = models.CharField(max_length=50, default='active')
context_type = models.CharField(
max_length=50,
choices=CONTEXT_TYPE_CHOICES,
default='topic',
help_text="Primary dimension for this cluster (topic, attribute, service line)"
)
dimension_meta = models.JSONField(
default=dict,
blank=True,
help_text="Extended metadata (taxonomy hints, attribute suggestions, coverage targets)"
)
created_at = models.DateTimeField(auto_now_add=True)
updated_at = models.DateTimeField(auto_now=True)
@@ -41,7 +24,6 @@ class Clusters(SiteSectorBaseModel):
models.Index(fields=['name']),
models.Index(fields=['status']),
models.Index(fields=['site', 'sector']),
models.Index(fields=['context_type']),
]
def __str__(self):