From c81d0519a04e72fc7d1da3ef5ad84dab2213a66e Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Wed, 22 Feb 2017 20:32:05 -0600 Subject: [PATCH] countdown: fields for sending reminders extending countdown items in order to have them also store reminders, which are the same idea (an event at a time) but these are watched by the irc bot and sent to the specified destination when the time is reached this adds support for configuring this, code in support of it is coming in later commits bss/dr.botzo#11 --- .../migrations/0003_auto_20170222_2025.py | 35 +++++++++++++++++++ countdown/models.py | 6 ++++ 2 files changed, 41 insertions(+) create mode 100644 countdown/migrations/0003_auto_20170222_2025.py diff --git a/countdown/migrations/0003_auto_20170222_2025.py b/countdown/migrations/0003_auto_20170222_2025.py new file mode 100644 index 0000000..af04f97 --- /dev/null +++ b/countdown/migrations/0003_auto_20170222_2025.py @@ -0,0 +1,35 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-02-23 02:25 +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('countdown', '0002_remove_countdownitem_source'), + ] + + operations = [ + migrations.AddField( + model_name='countdownitem', + name='is_reminder', + field=models.BooleanField(default=False), + ), + migrations.AddField( + model_name='countdownitem', + name='reminder_message', + field=models.TextField(default=''), + ), + migrations.AddField( + model_name='countdownitem', + name='reminder_target', + field=models.CharField(default='', max_length=64), + ), + migrations.AddField( + model_name='countdownitem', + name='sent_reminder', + field=models.BooleanField(default=False), + ), + ] diff --git a/countdown/models.py b/countdown/models.py index 6622b90..cc56e7a 100644 --- a/countdown/models.py +++ b/countdown/models.py @@ -16,6 +16,12 @@ class CountdownItem(models.Model): name = models.CharField(max_length=64, default='') at_time = models.DateTimeField() + is_reminder = models.BooleanField(default=False) + sent_reminder = models.BooleanField(default=False) + + reminder_message = models.TextField(default="") + reminder_target = models.CharField(max_length=64, default='') + created_time = models.DateTimeField(auto_now_add=True) def __str__(self):