gold eggs backend
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
Some checks failed
Build and Push to Docker Hub / build-test-push (push) Failing after 1m55s
This commit is contained in:
47
core/http/models/another.py
Normal file
47
core/http/models/another.py
Normal file
@@ -0,0 +1,47 @@
|
||||
from django.db import models
|
||||
from polymorphic import models as polymorphic
|
||||
from django.utils.translation import gettext as _
|
||||
|
||||
|
||||
class Tags(models.Model):
|
||||
name = models.CharField(max_length=255)
|
||||
|
||||
def __str__(self):
|
||||
return self.name
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Tag")
|
||||
verbose_name_plural = _("Tags")
|
||||
|
||||
|
||||
class Comment(models.Model):
|
||||
text = models.CharField(max_length=255)
|
||||
|
||||
def __str__(self) -> str:
|
||||
return self.text
|
||||
|
||||
|
||||
class BaseComment(polymorphic.PolymorphicModel):
|
||||
comments = models.ManyToManyField(Comment)
|
||||
|
||||
|
||||
class Post(BaseComment):
|
||||
title = models.CharField(max_length=255)
|
||||
desc = models.TextField()
|
||||
image = models.ImageField(upload_to="posts/", blank=True)
|
||||
tags = models.ManyToManyField(Tags)
|
||||
|
||||
def __str__(self):
|
||||
return self.title
|
||||
|
||||
|
||||
class FrontendTranslation(BaseComment):
|
||||
key = models.CharField(max_length=255, unique=True)
|
||||
value = models.TextField()
|
||||
|
||||
def __str__(self):
|
||||
return self.key
|
||||
|
||||
class Meta:
|
||||
verbose_name = _("Frontend Translation")
|
||||
verbose_name_plural = _("Frontend Translations")
|
||||
Reference in New Issue
Block a user