Skip to main content
---
Модуль: 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 = 'Главный баннер'

Metadata

Release files for monocle_mainbanner 0.1.5

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for monocle_mainbanner 0.1.5
File Size Uploaded Provenance Actions
monocle_mainbanner-0.1.5.tar.gz 304.7 kB Without provenance Details for monocle_mainbanner-0.1.5.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for monocle_mainbanner 0.1.5
File Interpreter ABI Platform Actions
monocle_mainbanner-0.1.5-py3-none-any.whl Python 3 none any Details for monocle_mainbanner-0.1.5-py3-none-any.whl

Total release size: 5.0 MB

Release files / monocle_mainbanner-0.1.5.tar.gz

Download URL monocle_mainbanner-0.1.5.tar.gz
Size 304.7 kB
Tags Source
SHA-256 checksum
How to use checksums
940b30c2a89ee5e8fd130fd6cbba83ad92e16bf594177132503034ffe8944564
BLAKE2b-256 checksum
How to use checksums
3b8668c50a312ceb69f7fc0652fabd2e01c5197b7149dbddfe4decbf5c024aab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / monocle_mainbanner-0.1.5-py3-none-any.whl

Download URL monocle_mainbanner-0.1.5-py3-none-any.whl
Size 4.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
9dc6e6912435ef71dc22e2868010bcd9aefccdb626cc96a4d86c7584ce68ac1e
BLAKE2b-256 checksum
How to use checksums
69ab9ddaf9b3dec661dd7ae2ddf90f0e48e57c2a573d67398908abc84203df2d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for monocle_mainbanner 0.1.5

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page