Skip to main content

Sample app for django-monocle project generated by scaffolder

Project description

— ### Модуль: monocle_timer —

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

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

![Timer](/images_readme/timer_admin2.png)

## Файл models.py:

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

import datetime from django.utils.timezone import utc

class Timer(SingletonModel):

text = models.TextField(verbose_name=u’Текст акции’, help_text=u’Не более 200 символов’, blank=False) deadline = models.DateTimeField(verbose_name=u’Срок окончания акции’, blank=False) isShown = models.BooleanField(default=True,help_text= u’Отображать таймер на сайте’, verbose_name=u’Показывать’)

def get_countdown(self):

#get current time now = datetime.datetime.utcnow().replace(tzinfo=utc)

#calculate time difference self.delta = (self.deadline - now)

#return rounded seconds return int(self.delta.total_seconds())

def __str__(self):

return u’Таймер’

class Meta:

verbose_name_plural = u’Таймер’ verbose_name = u’Таймер’

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_timer-0.2.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

monocle_timer-0.2.3-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file monocle_timer-0.2.3.tar.gz.

File metadata

File hashes

Hashes for monocle_timer-0.2.3.tar.gz
Algorithm Hash digest
SHA256 3f009fa700894ed391219e3ced05069d54e703c592b6b210cbfd5ce2812ba09d
MD5 62d8d4bb767b5abf79231b9b51c27be4
BLAKE2b-256 2e93f85d48c4a3dc28964595bfef8b7deeb5737e7ec579e642ce7e65d6ae3dca

See more details on using hashes here.

File details

Details for the file monocle_timer-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for monocle_timer-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b7c411e291feec05bfdb5d5b6551682acf247b198487bd7a6d1b0152573884c0
MD5 d059b0ca406fa925fe9895e6e20ac735
BLAKE2b-256 95e3b4dafe60ebf78dcb575759e2849bb83293925a46c24eb4e4d191c11f2ff8

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