add article date field

This commit is contained in:
Tobias Brunner 2025-07-04 15:51:44 +02:00
parent 470887c34e
commit 6351da70ee
No known key found for this signature in database
6 changed files with 42 additions and 19 deletions

View file

@ -3,6 +3,7 @@ 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 .services import Service
from .providers import CloudProvider, ConsultingPartner
@ -23,6 +24,9 @@ class Article(models.Model):
help_text="Title picture for the article",
)
author = models.ForeignKey(User, on_delete=models.CASCADE, related_name="articles")
article_date = models.DateField(
default=timezone.now, help_text="Date of the article publishing"
)
# Relations to other models
related_service = models.ForeignKey(