0.0.9 section view

This commit is contained in:
SDE
2023-11-26 18:29:37 +03:00
parent 8afefc9aff
commit eef2ca509a
13 changed files with 99 additions and 8 deletions

0
SlidesApp/__init__.py Normal file
View File

3
SlidesApp/admin.py Normal file
View File

@@ -0,0 +1,3 @@
from django.contrib import admin
# Register your models here.

6
SlidesApp/apps.py Normal file
View File

@@ -0,0 +1,6 @@
from django.apps import AppConfig
class SlidesappConfig(AppConfig):
default_auto_field = 'django.db.models.BigAutoField'
name = 'SlidesApp'

View File

32
SlidesApp/models.py Normal file
View File

@@ -0,0 +1,32 @@
from django.db import models
from BaseModels.base_models import BaseModelViewPage, BaseModel
from django.utils.translation import gettext_lazy as _
# from ckeditor.fields import RichTextField
from ckeditor_uploader.fields import RichTextUploadingField
# from colorfield.fields import ColorField
from django.contrib.contenttypes.models import ContentType
from django.contrib.contenttypes.fields import GenericForeignKey
from django.contrib.contenttypes.fields import GenericRelation
from colorfield.fields import ColorField
class Slide(BaseModel):
content_type = models.ForeignKey(ContentType, on_delete=models.SET_NULL, null=True)
object_id = models.PositiveIntegerField()
content_object = GenericForeignKey('content_type', 'object_id')
url = models.TextField(verbose_name=_('URL привязанной страницы'), blank=True, null=True)
title = models.TextField(verbose_name=_('Заголовок'), null=True, blank=True)
description = RichTextUploadingField(verbose_name=_('Краткое описание'), null=True, blank=True)
text = RichTextUploadingField(verbose_name=_('Полное описание'), null=True, blank=True, )
picture = models.ImageField(
upload_to='uploads/', verbose_name=_('Фоновое изображение'), null=True, blank=True)
bg_color = ColorField(verbose_name=_('Цвет фона'), default='#FFFFFF')
but_title = models.CharField(max_length=100, verbose_name=_('Текст на кнопке'), null=True, blank=True)
but_color = ColorField(verbose_name=_('Цвет кнопки'), default='#000000')
class Meta:
verbose_name = _('Слайд')
verbose_name_plural = _('Слайды')

3
SlidesApp/tests.py Normal file
View File

@@ -0,0 +1,3 @@
from django.test import TestCase
# Create your tests here.

3
SlidesApp/views.py Normal file
View File

@@ -0,0 +1,3 @@
from django.shortcuts import render
# Create your views here.