Stage 1 migration and docs complete
This commit is contained in:
@@ -6,9 +6,9 @@ from igny8_core.business.content.models import ContentTaxonomy, ContentAttribute
|
||||
|
||||
@admin.register(Tasks)
|
||||
class TasksAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
list_display = ['title', 'entity_type', 'cluster_role', 'site', 'sector', 'status', 'cluster', 'created_at']
|
||||
list_filter = ['status', 'entity_type', 'cluster_role', 'site', 'sector', 'cluster']
|
||||
search_fields = ['title', 'description', 'keywords']
|
||||
list_display = ['title', 'content_type', 'content_structure', 'site', 'sector', 'status', 'cluster', 'created_at']
|
||||
list_filter = ['status', 'content_type', 'content_structure', 'site', 'sector', 'cluster']
|
||||
search_fields = ['title', 'description']
|
||||
ordering = ['-created_at']
|
||||
readonly_fields = ['created_at', 'updated_at']
|
||||
|
||||
@@ -17,10 +17,10 @@ class TasksAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
'fields': ('title', 'description', 'status', 'site', 'sector')
|
||||
}),
|
||||
('Content Classification', {
|
||||
'fields': ('entity_type', 'cluster_role', 'taxonomy')
|
||||
'fields': ('content_type', 'content_structure', 'taxonomy_term')
|
||||
}),
|
||||
('Planning', {
|
||||
'fields': ('cluster', 'idea', 'keywords')
|
||||
'fields': ('cluster', 'keywords')
|
||||
}),
|
||||
('Timestamps', {
|
||||
'fields': ('created_at', 'updated_at'),
|
||||
@@ -56,7 +56,7 @@ class TasksAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
class ImagesAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
list_display = ['get_content_title', 'site', 'sector', 'image_type', 'status', 'position', 'created_at']
|
||||
list_filter = ['image_type', 'status', 'site', 'sector']
|
||||
search_fields = ['content__title', 'content__meta_title', 'task__title']
|
||||
search_fields = ['content__title']
|
||||
ordering = ['-id'] # Sort by ID descending (newest first)
|
||||
|
||||
def get_content_title(self, obj):
|
||||
@@ -86,35 +86,32 @@ class ImagesAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
|
||||
@admin.register(Content)
|
||||
class ContentAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
list_display = ['title', 'entity_type', 'content_format', 'cluster_role', 'site', 'sector', 'source', 'sync_status', 'word_count', 'generated_at']
|
||||
list_filter = ['entity_type', 'content_format', 'cluster_role', 'source', 'sync_status', 'status', 'site', 'sector', 'generated_at']
|
||||
search_fields = ['title', 'meta_title', 'primary_keyword', 'task__title', 'external_url']
|
||||
ordering = ['-generated_at']
|
||||
readonly_fields = ['generated_at', 'updated_at']
|
||||
list_display = ['title', 'content_type', 'content_structure', 'site', 'sector', 'source', 'status', 'created_at']
|
||||
list_filter = ['content_type', 'content_structure', 'source', 'status', 'site', 'sector', 'created_at']
|
||||
search_fields = ['title', 'content_html', 'external_url']
|
||||
ordering = ['-created_at']
|
||||
readonly_fields = ['created_at', 'updated_at']
|
||||
|
||||
fieldsets = (
|
||||
('Basic Info', {
|
||||
'fields': ('title', 'task', 'site', 'sector', 'cluster', 'status')
|
||||
'fields': ('title', 'site', 'sector', 'cluster', 'status')
|
||||
}),
|
||||
('Content Classification', {
|
||||
'fields': ('entity_type', 'content_format', 'cluster_role', 'external_type')
|
||||
'fields': ('content_type', 'content_structure', 'source')
|
||||
}),
|
||||
('Content', {
|
||||
'fields': ('html_content', 'word_count', 'json_blocks', 'structure_data')
|
||||
'fields': ('content_html',)
|
||||
}),
|
||||
('SEO', {
|
||||
'fields': ('meta_title', 'meta_description', 'primary_keyword', 'secondary_keywords')
|
||||
('Taxonomy', {
|
||||
'fields': ('taxonomy_terms',),
|
||||
'description': 'Categories, tags, and other taxonomy terms'
|
||||
}),
|
||||
('WordPress Sync', {
|
||||
'fields': ('source', 'sync_status', 'external_id', 'external_url', 'sync_metadata'),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
('Optimization', {
|
||||
'fields': ('linker_version', 'optimizer_version', 'optimization_scores', 'internal_links'),
|
||||
'fields': ('external_id', 'external_url'),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
('Timestamps', {
|
||||
'fields': ('generated_at', 'updated_at'),
|
||||
'fields': ('created_at', 'updated_at'),
|
||||
'classes': ('collapse',)
|
||||
}),
|
||||
)
|
||||
@@ -137,32 +134,23 @@ class ContentAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
|
||||
@admin.register(ContentTaxonomy)
|
||||
class ContentTaxonomyAdmin(SiteSectorAdminMixin, admin.ModelAdmin):
|
||||
list_display = ['name', 'taxonomy_type', 'slug', 'parent', 'external_id', 'external_taxonomy', 'sync_status', 'count', 'site', 'sector']
|
||||
list_filter = ['taxonomy_type', 'sync_status', 'site', 'sector', 'parent']
|
||||
search_fields = ['name', 'slug', 'description', 'external_taxonomy']
|
||||
list_display = ['name', 'taxonomy_type', 'slug', 'external_id', 'external_taxonomy', 'site', 'sector']
|
||||
list_filter = ['taxonomy_type', 'site', 'sector']
|
||||
search_fields = ['name', 'slug', 'external_taxonomy']
|
||||
ordering = ['taxonomy_type', 'name']
|
||||
filter_horizontal = ['clusters']
|
||||
|
||||
fieldsets = (
|
||||
('Basic Info', {
|
||||
'fields': ('name', 'slug', 'taxonomy_type', 'description', 'site', 'sector')
|
||||
}),
|
||||
('Hierarchy', {
|
||||
'fields': ('parent',),
|
||||
'description': 'Set parent for hierarchical taxonomies (categories).'
|
||||
'fields': ('name', 'slug', 'taxonomy_type', 'site', 'sector')
|
||||
}),
|
||||
('WordPress Sync', {
|
||||
'fields': ('external_id', 'external_taxonomy', 'sync_status', 'count', 'metadata')
|
||||
}),
|
||||
('Semantic Mapping', {
|
||||
'fields': ('clusters',),
|
||||
'description': 'Map this taxonomy to semantic clusters for AI optimization.'
|
||||
'fields': ('external_id', 'external_taxonomy')
|
||||
}),
|
||||
)
|
||||
|
||||
def get_queryset(self, request):
|
||||
qs = super().get_queryset(request)
|
||||
return qs.select_related('parent', 'site', 'sector').prefetch_related('clusters')
|
||||
return qs.select_related('site', 'sector')
|
||||
|
||||
|
||||
@admin.register(ContentAttribute)
|
||||
|
||||
Reference in New Issue
Block a user