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
Built Distribution
File details
Details for the file monocle_partners-0.2.0.2.tar.gz
.
File metadata
- Download URL: monocle_partners-0.2.0.2.tar.gz
- Upload date:
- Size: 226.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8852c8c8692f7e288c9761152440d7a889ccf9317bcad94618cdaf476062194d |
|
MD5 | d83bd444ea5a5d599650cf819a8a09df |
|
BLAKE2b-256 | 5a0dc58ad1eafbbeb97de49158c4389b60005bde6a0a565cd97ab6adf0f677bf |
File details
Details for the file monocle_partners-0.2.0.2-py3-none-any.whl
.
File metadata
- Download URL: monocle_partners-0.2.0.2-py3-none-any.whl
- Upload date:
- Size: 269.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c45ebd0a207c63ae961c158e620c79f931160676f8d41915b072f804f174b6ae |
|
MD5 | 59e3fa9860b4059379244ddae4b7f932 |
|
BLAKE2b-256 | 33eb54e8d79a40307b98289bd4a57e3a2c44980bf2f8e8c9d5bcc599a3b68753 |