feat: change entire downloads
This commit is contained in:
@@ -1,5 +1,7 @@
|
||||
from django.db import models
|
||||
|
||||
from apps.core.utils import CONTENT_FORMAT_CHOICES, FORMAT_PLAIN, render_content
|
||||
|
||||
|
||||
class ContactSubmission(models.Model):
|
||||
name = models.CharField(max_length=200)
|
||||
@@ -21,6 +23,9 @@ class ContactSubmission(models.Model):
|
||||
class FAQEntry(models.Model):
|
||||
question = models.CharField(max_length=500)
|
||||
answer = models.TextField()
|
||||
answer_format = models.CharField(
|
||||
max_length=20, choices=CONTENT_FORMAT_CHOICES, default=FORMAT_PLAIN
|
||||
)
|
||||
order = models.PositiveIntegerField(default=0)
|
||||
is_active = models.BooleanField(default=True)
|
||||
created_at = models.DateTimeField(auto_now_add=True)
|
||||
@@ -34,6 +39,10 @@ class FAQEntry(models.Model):
|
||||
def __str__(self):
|
||||
return self.question
|
||||
|
||||
@property
|
||||
def rendered_answer(self):
|
||||
return render_content(self.answer, self.answer_format)
|
||||
|
||||
|
||||
class DownloadItem(models.Model):
|
||||
PLATFORM_WINDOWS = "windows"
|
||||
|
||||
Reference in New Issue
Block a user