27 lines
601 B
Python
27 lines
601 B
Python
"""Countdown item models."""
|
|
|
|
from __future__ import unicode_literals
|
|
|
|
import logging
|
|
|
|
from django.db import models
|
|
from django.utils import timezone
|
|
|
|
|
|
log = logging.getLogger('countdown.models')
|
|
|
|
|
|
class CountdownItem(models.Model):
|
|
|
|
"""Track points in time."""
|
|
|
|
name = models.CharField(max_length=64, default='')
|
|
at_time = models.DateTimeField()
|
|
|
|
created_time = models.DateTimeField(auto_now_add=True)
|
|
|
|
def __unicode__(self):
|
|
"""String representation."""
|
|
|
|
return "{0:s} @ {1:s}".format(self.name, timezone.localtime(self.at_time).strftime('%Y-%m-%d %H:%M:%S %Z'))
|