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.

Filename, size & hash SHA256 hash help File type Python version Upload date
monocle_slider-0.1.4-py3-none-any.whl (3.8 MB) Copy SHA256 hash SHA256 Wheel 3.4 May 29, 2015
monocle_slider-0.1.4.tar.gz (370.8 kB) Copy SHA256 hash SHA256 Source None May 29, 2015

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page