Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Sample app for django-monocle project generated by scaffolder

Project Description
---
Модуль: monocle_mainbanner
---

Модуль отображающий главный баннер сайта в виде карусели с изображениями

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

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

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

from django.db import models
from solo.models import SingletonModel

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

from filebrowser.fields import FileBrowseField

class MainBanner(SingletonModel):
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='false', blank=False, verbose_name='Стрелки навигации')
pagination = models.CharField(max_length=5, choices=CHOICES_PAGIN, default='false', 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, blank=True, verbose_name= 'Заголовок')
slider = models.ForeignKey('MainBanner', verbose_name= 'Баннер')
image = FileBrowseField(max_length=200, directory="'banner", extensions=[".jpg", ".png", ".jpeg"], 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)

def __str__(self):
return self.name

class Meta:
verbose_name_plural = u'Слайды'
verbose_name = u'Слайд'
ordering = ['position']
from django.apps import AppConfig
class CustomAppConfig(AppConfig):
name = 'apps.monocle_mainbanner'
verbose_name = 'Главный баннер'
Release History

Release History

This version
History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2

History Node

0.1.1

History Node

0.1.0

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
monocle_mainbanner-0.1.5-py3-none-any.whl (4.7 MB) Copy SHA256 Checksum SHA256 3.4 Wheel May 29, 2015
monocle_mainbanner-0.1.5.tar.gz (304.7 kB) Copy SHA256 Checksum SHA256 Source May 29, 2015

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting