make more countdown item fields optional in admin
This commit is contained in:
parent
bcc5f767ba
commit
a6f8fc5dc1
|
@ -0,0 +1,23 @@
|
||||||
|
# Generated by Django 3.1.2 on 2020-10-25 17:16
|
||||||
|
|
||||||
|
from django.db import migrations, models
|
||||||
|
|
||||||
|
|
||||||
|
class Migration(migrations.Migration):
|
||||||
|
|
||||||
|
dependencies = [
|
||||||
|
('countdown', '0005_countdownitem_recurring_until'),
|
||||||
|
]
|
||||||
|
|
||||||
|
operations = [
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='countdownitem',
|
||||||
|
name='recurring_period',
|
||||||
|
field=models.CharField(blank=True, default='', max_length=64),
|
||||||
|
),
|
||||||
|
migrations.AlterField(
|
||||||
|
model_name='countdownitem',
|
||||||
|
name='reminder_target',
|
||||||
|
field=models.CharField(blank=True, default='', max_length=64),
|
||||||
|
),
|
||||||
|
]
|
|
@ -1,14 +1,8 @@
|
||||||
"""Countdown item models."""
|
"""Countdown item models."""
|
||||||
|
|
||||||
import logging
|
|
||||||
|
|
||||||
from django.db import models
|
from django.db import models
|
||||||
from django.utils import timezone
|
from django.utils import timezone
|
||||||
|
|
||||||
|
|
||||||
log = logging.getLogger('countdown.models')
|
|
||||||
|
|
||||||
|
|
||||||
class CountdownItem(models.Model):
|
class CountdownItem(models.Model):
|
||||||
"""Track points in time."""
|
"""Track points in time."""
|
||||||
|
|
||||||
|
@ -19,13 +13,13 @@ class CountdownItem(models.Model):
|
||||||
sent_reminder = models.BooleanField(default=False)
|
sent_reminder = models.BooleanField(default=False)
|
||||||
|
|
||||||
reminder_message = models.TextField(default="")
|
reminder_message = models.TextField(default="")
|
||||||
reminder_target = models.CharField(max_length=64, default='')
|
reminder_target = models.CharField(max_length=64, blank=True, default='')
|
||||||
|
|
||||||
recurring_period = models.CharField(max_length=64, default='')
|
recurring_period = models.CharField(max_length=64, blank=True, default='')
|
||||||
recurring_until = models.DateTimeField(null=True, blank=True, default=None)
|
recurring_until = models.DateTimeField(null=True, blank=True, default=None)
|
||||||
|
|
||||||
created_time = models.DateTimeField(auto_now_add=True)
|
created_time = models.DateTimeField(auto_now_add=True)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
"""String representation."""
|
"""Summarize object."""
|
||||||
return "{0:s} @ {1:s}".format(self.name, timezone.localtime(self.at_time).strftime('%Y-%m-%d %H:%M:%S %Z'))
|
return "{0:s} @ {1:s}".format(self.name, timezone.localtime(self.at_time).strftime('%Y-%m-%d %H:%M:%S %Z'))
|
||||||
|
|
Loading…
Reference in New Issue