Skip to main content

Slider app for monocle project

Project description

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


## **Пример отображения на сайте:**
![Slider](/readme_images/slider.png)

## **Пример отображения в панели администрирования:**
![Slider](/readme_images/slider_admin.png)

## **Файл models.py:**

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):
return self.name

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.4.tar.gz (370.8 kB view details)

Uploaded Source

Built Distribution

monocle_slider-0.1.4-py3-none-any.whl (3.8 MB view details)

Uploaded Python 3

File details

Details for the file monocle_slider-0.1.4.tar.gz.

File metadata

File hashes

Hashes for monocle_slider-0.1.4.tar.gz
Algorithm Hash digest
SHA256 b9b3de771ce83db676cc1331df28bdd39abe2fdcbd38c2dfc757ccb8da81bd0e
MD5 ec0d72fc0f1cbe10d181dbad390b4e5d
BLAKE2b-256 ace30a988cbef32a1f96d4e6573824431d5e108e846ee33d0ee6b7a177f8667e

See more details on using hashes here.

File details

Details for the file monocle_slider-0.1.4-py3-none-any.whl.

File metadata

File hashes

Hashes for monocle_slider-0.1.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a74efcb866668d668b85cbc0d00e51b935b0f46e17378f17ab455855afdd5ea4
MD5 9962c55ee66ade3946321160b251a264
BLAKE2b-256 530b472c03862bff78b7ca7db418d032fad2f2206dc7bcc7c9df47de0c278e8d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page