images in ckeditor
This commit is contained in:
SDE
2023-09-22 14:58:06 +03:00
parent 4888fc7211
commit 4ec85b85cb
6 changed files with 304 additions and 79 deletions

View File

@@ -10,7 +10,8 @@ from django.utils.translation import gettext_lazy as _
from django.db.models.signals import post_save, pre_save
from django.utils.text import slugify
from django.contrib.postgres.fields import JSONField
from ckeditor.fields import RichTextField
# from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
from django.contrib.contenttypes.fields import GenericRelation
@@ -86,9 +87,9 @@ class BaseModelViewPage(BaseModel):
help_text=_(
'можно изменить адрес страницы (!!! ВНИМАНИЕ !!! поисковые системы потеряют страницу и найдут лишь спустя неделю...месяц)'))
title = models.TextField(verbose_name=_('Заголовок'), null=True, blank=True)
description = RichTextField(verbose_name=_('Краткое описание'), null=True, blank=True, # max_length=240,
description = RichTextUploadingField(verbose_name=_('Краткое описание'), null=True, blank=True, # max_length=240,
help_text=_('краткое описание страницы (до 240 символов)'))
text = RichTextField(verbose_name=_('Полное описание'), null=True, blank=True, )
text = RichTextUploadingField(verbose_name=_('Полное описание'), null=True, blank=True, )
# help_text=_(u'краткое описание страницы (до 240 символов)'))
picture = models.ImageField(upload_to='uploads/', verbose_name=_('Картинка'), null=True, blank=True,
help_text=u'')
@@ -102,7 +103,7 @@ class BaseModelViewPage(BaseModel):
seo_description = models.CharField(max_length=250, verbose_name=_('Description (150 знаков)'), null=True,
blank=True)
seo_keywords = models.CharField(max_length=250, verbose_name=_('Keywords (200 знаков)'), null=True, blank=True)
seo_text = RichTextField(verbose_name=_(u'Текст SEO статьи'), null=True, blank=True)
seo_text = RichTextUploadingField(verbose_name=_(u'Текст SEO статьи'), null=True, blank=True)
FAQ_title = models.CharField(max_length=250, verbose_name=_(u'FAQ Заголовок'), null=True, blank=True)
FAQ_items = GenericRelation('GeneralApp.FAQitem', related_query_name='grel_%(class)s_for_faq_item')