feat: change entire downloads

This commit is contained in:
mohamad
2026-05-16 19:13:32 +03:30
parent eb880e3e8b
commit f0a9d5832b
26 changed files with 1283 additions and 213 deletions
+9
View File
@@ -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"