models.py 702 B

12345678910111213141516171819202122232425
  1. from django.db import models
  2. from django.urls import reverse
  3. from ckeditor.fields import RichTextField
  4. class ButlerPage(models.Model):
  5. title = models.CharField(max_length=150)
  6. slug = models.SlugField(unique=True)
  7. content = RichTextField(blank=True, null=True)
  8. def __str__(self) -> str:
  9. return self.title
  10. class Meta:
  11. verbose_name = 'Простая страница'
  12. verbose_name_plural = 'Простые страницы'
  13. class FAQmodel(models.Model):
  14. question = models.TextField(blank=True)
  15. answer = models.TextField(blank=True)
  16. def __str__(self) -> str:
  17. return self.question
  18. class Meta:
  19. verbose_name = 'FAQ'