Skip to main content

Partners for monocle

Project description

— Модуль: monocle_partners —

Модуль для отображения партнеров на странице сайта. Изначально логотипы черно-белые, а при наведении курсора мыши становятся цветными.

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

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

![Partners](/images_readme/partners_admin2.png)

## Файл models.py:

from django.db import models from easy_thumbnails.fields import ThumbnailerImageField

class Partner(models.Model):

name = models.CharField(max_length=255, blank=False, verbose_name=’Название партнера’) url = models.CharField(max_length=255, blank=False, verbose_name=’Ссылка на сайт’) image = models.ImageField(upload_to=’partners/%Y/%m/%d’, verbose_name=’Логотип’) position = models.PositiveIntegerField(default=0, verbose_name=’Позиция’) isShown = models.BooleanField(default=True, verbose_name=’Показывать партнера’)

def __str__(self):

return self.name

def image_admin(self):

return u’<img src=”%s” height=”80” />’ % self.image.url

image_admin.short_description = u’Изображение’ image_admin.allow_tags = True

class Meta:

verbose_name_plural = u’Партнеры’ verbose_name = u’Партнер’ ordering = [‘position’]

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_partners-0.2.0.2.tar.gz (226.0 kB view details)

Uploaded Source

Built Distribution

monocle_partners-0.2.0.2-py3-none-any.whl (269.4 kB view details)

Uploaded Python 3

File details

Details for the file monocle_partners-0.2.0.2.tar.gz.

File metadata

File hashes

Hashes for monocle_partners-0.2.0.2.tar.gz
Algorithm Hash digest
SHA256 8852c8c8692f7e288c9761152440d7a889ccf9317bcad94618cdaf476062194d
MD5 d83bd444ea5a5d599650cf819a8a09df
BLAKE2b-256 5a0dc58ad1eafbbeb97de49158c4389b60005bde6a0a565cd97ab6adf0f677bf

See more details on using hashes here.

File details

Details for the file monocle_partners-0.2.0.2-py3-none-any.whl.

File metadata

File hashes

Hashes for monocle_partners-0.2.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 c45ebd0a207c63ae961c158e620c79f931160676f8d41915b072f804f174b6ae
MD5 59e3fa9860b4059379244ddae4b7f932
BLAKE2b-256 33eb54e8d79a40307b98289bd4a57e3a2c44980bf2f8e8c9d5bcc599a3b68753

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