feat: Add Global Module Settings and Caption to Images
- Introduced GlobalModuleSettings model for platform-wide module enable/disable settings. - Added 'caption' field to Images model to store image captions. - Updated GenerateImagePromptsFunction to handle new caption structure in prompts. - Enhanced AIPromptViewSet to return global prompt types and validate active prompts. - Modified serializers and views to accommodate new caption field and global settings. - Updated frontend components to display captions and filter prompts based on active types. - Created migrations for GlobalModuleSettings and added caption field to Images.
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
# Generated by Django 5.2.9 on 2025-12-20 20:39
|
||||
|
||||
from django.db import migrations, models
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('writer', '0012_soft_delete'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='images',
|
||||
name='caption',
|
||||
field=models.TextField(blank=True, help_text='Image caption (40-60 words) to display with the image', null=True),
|
||||
),
|
||||
]
|
||||
@@ -89,6 +89,7 @@ class ImagesSerializer(serializers.ModelSerializer):
|
||||
'image_url',
|
||||
'image_path',
|
||||
'prompt',
|
||||
'caption',
|
||||
'status',
|
||||
'position',
|
||||
'created_at',
|
||||
@@ -126,6 +127,7 @@ class ContentImageSerializer(serializers.ModelSerializer):
|
||||
'image_url',
|
||||
'image_path',
|
||||
'prompt',
|
||||
'caption',
|
||||
'status',
|
||||
'position',
|
||||
'created_at',
|
||||
|
||||
Reference in New Issue
Block a user