rework prose editor configuration

This commit is contained in:
Tobias Brunner 2025-07-08 16:24:28 +02:00
parent 6b689704b0
commit 166f518db0
No known key found for this signature in database
5 changed files with 46 additions and 15 deletions

View file

@ -2,9 +2,8 @@ from django.db import models
from django.urls import reverse
from django.utils.text import slugify
from django.contrib.auth.models import User
from django_prose_editor.fields import ProseEditorField
from django.utils import timezone
from .base import validate_image_size
from .base import validate_image_size, get_prose_editor_field
from .services import Service
from .providers import CloudProvider, ConsultingPartner
from .images import ImageReference
@ -16,7 +15,7 @@ class Article(ImageReference):
excerpt = models.TextField(
max_length=500, help_text="Brief description of the article"
)
content = ProseEditorField()
content = get_prose_editor_field()
meta_keywords = models.CharField(
max_length=255, blank=True, help_text="SEO keywords separated by commas"
)
@ -57,7 +56,7 @@ class Article(ImageReference):
blank=True,
null=True,
validators=[validate_image_size],
help_text="Optional Open Graph image for social sharing (max 1MB). If not provided, the article's main image will be used."
help_text="Optional Open Graph image for social sharing (max 1MB). If not provided, the article's main image will be used.",
)
# Publishing controls