mirror of
https://github.com/pacnpal/thrillwiki_django_no_react.git
synced 2025-12-30 08:27:00 -05:00
feat: Implement MFA authentication, add ride statistics model, and update various services, APIs, and tests across the application.
This commit is contained in:
@@ -1,12 +1,15 @@
|
||||
from django.db import models
|
||||
from django.conf import settings
|
||||
from apps.core.models import SluggedModel
|
||||
from django.db import models
|
||||
|
||||
# Using string reference for CloudflareImage
|
||||
from django_cloudflareimages_toolkit.models import CloudflareImage
|
||||
|
||||
from apps.core.models import SluggedModel
|
||||
|
||||
|
||||
class Tag(SluggedModel):
|
||||
name = models.CharField(max_length=50, unique=True)
|
||||
|
||||
|
||||
class Meta:
|
||||
ordering = ["name"]
|
||||
|
||||
@@ -17,7 +20,7 @@ class Post(SluggedModel):
|
||||
title = models.CharField(max_length=255)
|
||||
content = models.TextField(help_text="Markdown content supported")
|
||||
excerpt = models.TextField(blank=True, help_text="Short summary for lists")
|
||||
|
||||
|
||||
image = models.ForeignKey(
|
||||
CloudflareImage,
|
||||
on_delete=models.SET_NULL,
|
||||
@@ -26,18 +29,18 @@ class Post(SluggedModel):
|
||||
related_name="blog_posts",
|
||||
help_text="Featured image"
|
||||
)
|
||||
|
||||
|
||||
author = models.ForeignKey(
|
||||
settings.AUTH_USER_MODEL,
|
||||
on_delete=models.CASCADE,
|
||||
related_name="blog_posts"
|
||||
)
|
||||
|
||||
|
||||
published_at = models.DateTimeField(null=True, blank=True, db_index=True)
|
||||
is_published = models.BooleanField(default=False, db_index=True)
|
||||
|
||||
|
||||
tags = models.ManyToManyField(Tag, blank=True, related_name="posts")
|
||||
|
||||
|
||||
class Meta:
|
||||
ordering = ["-published_at", "-created_at"]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user