Skip to main content

Slider app for monocle project

Project description

### *monocle_slider app*
### Модуль: monocle_slider

## **Пример отображения на сайте:**

## **Пример отображения в панели администрирования:**

## **Файл**

from django.db import models

CHOICES_PAGIN = (('true', 'С пагинацией',), ('false', 'Без пагинации',))
CHOICES_ARROWS = (('true', 'Со стрелками',), ('false', 'Без стрелок',))

from filebrowser.fields import FileBrowseField

class Slider(models.Model):
name = models.CharField(max_length=255, verbose_name= 'Название слайдера')
text = models.TextField(verbose_name='Подпись')
elem_number = models.PositiveSmallIntegerField(blank=False, default=1, verbose_name='Количество отображаемых слайдов')
isShown = models.BooleanField(default=True, verbose_name= 'Показывать')
arrows = models.CharField(max_length=5, choices=CHOICES_ARROWS, default='true', blank=False, verbose_name='Стрелки навигации')
pagination = models.CharField(max_length=5, choices=CHOICES_PAGIN, default='true', blank=False, verbose_name='Пагинация')

def __str__(self):

class Meta:
verbose_name_plural = u'Слайдеры'
verbose_name = u'Слайдер'

class Slide(models.Model):
name = models.CharField(max_length=255, verbose_name='Название')
slider = models.ForeignKey('Slider', verbose_name= 'Слайдер')
image = FileBrowseField(max_length=200, directory="'slider", extensions=[".jpg", ".png", ".jpeg", ".ico", ], blank=True, null=True, verbose_name= 'Изображение')
text = models.TextField(verbose_name='Подпись', blank=True)
isShown = models.BooleanField(default=True, verbose_name='Показывать слайд')
position = models.PositiveSmallIntegerField(default=0)

class Meta:
verbose_name_plural = u'Слайды'
verbose_name = u'Слайд'
ordering = ['position']

from django.apps import AppConfig
class CustomAppConfig(AppConfig):
name = 'apps.monocle_slider'
verbose_name = 'Слайдер'

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

monocle_slider-0.1.1.tar.gz (3.3 MB view hashes)

Uploaded source

Built Distribution

monocle_slider-0.1.1-py3-none-any.whl (3.3 MB view hashes)

Uploaded 3 4

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page