add article date field
This commit is contained in:
parent
470887c34e
commit
6351da70ee
6 changed files with 42 additions and 19 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue