0.0.9 section view
This commit is contained in:
0
SlidesApp/__init__.py
Normal file
0
SlidesApp/__init__.py
Normal file
3
SlidesApp/admin.py
Normal file
3
SlidesApp/admin.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.contrib import admin
|
||||
|
||||
# Register your models here.
|
||||
6
SlidesApp/apps.py
Normal file
6
SlidesApp/apps.py
Normal file
@@ -0,0 +1,6 @@
|
||||
from django.apps import AppConfig
|
||||
|
||||
|
||||
class SlidesappConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'SlidesApp'
|
||||
0
SlidesApp/migrations/__init__.py
Normal file
0
SlidesApp/migrations/__init__.py
Normal file
32
SlidesApp/models.py
Normal file
32
SlidesApp/models.py
Normal 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
3
SlidesApp/tests.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.test import TestCase
|
||||
|
||||
# Create your tests here.
|
||||
3
SlidesApp/views.py
Normal file
3
SlidesApp/views.py
Normal file
@@ -0,0 +1,3 @@
|
||||
from django.shortcuts import render
|
||||
|
||||
# Create your views here.
|
||||
Reference in New Issue
Block a user