Skip to main content

Sample app for django-monocle project generated by scaffolder

Project description

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

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

## **Пример отображения в панели администрирования:**
![Banner](/readme_images/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 = 'Главный баннер'

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_mainbanner-0.1.3.tar.gz (986.1 kB view details)

Uploaded Source

Built Distribution

monocle_mainbanner-0.1.3-py3-none-any.whl (4.7 MB view details)

Uploaded Python 3

File details

Details for the file monocle_mainbanner-0.1.3.tar.gz.

File metadata

File hashes

Hashes for monocle_mainbanner-0.1.3.tar.gz
Algorithm Hash digest
SHA256 dd5a1cbcc1594c0716e99447ffeffcf3a1a1b4a576a7579e32ede7e715dfb583
MD5 727ea446cec981a6947ec54974f96291
BLAKE2b-256 653beb31e7206eb3dc76f7330b90245cf34d04838e7bf6d21f6a5d78e18781f5

See more details on using hashes here.

Provenance

File details

Details for the file monocle_mainbanner-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for monocle_mainbanner-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 40c1cdc08358ece44fbd9e75d291290c182add2dc1ffa4d11cc3c82a0e61f4a6
MD5 7908442206414fcbd10d236e7d665e3f
BLAKE2b-256 1b4002e62ca3c563d6c18cab93593f62443e013c65d405d82c1138c0c86c14d8

See more details on using hashes here.

Provenance

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