aboutsummaryrefslogtreecommitdiffstats
path: root/src/notifier/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/notifier/models.py')
-rw-r--r--src/notifier/models.py27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/notifier/models.py b/src/notifier/models.py
index 49189e8..382d3a9 100644
--- a/src/notifier/models.py
+++ b/src/notifier/models.py
@@ -9,6 +9,7 @@
from django.db import models
from account.models import UserProfile
+from booking.models import Booking
class Notification(models.Model):
@@ -23,3 +24,29 @@ class Notification(models.Model):
def to_preview_html(self):
return "<h3>" + self.title + "</h3>" # TODO - template?
+
+
+class Emailed(models.Model):
+ """
+ A simple record to remember who has already gotten an email
+ to avoid resending
+ """
+ begin_booking = models.OneToOneField(
+ Booking,
+ null=True,
+ on_delete=models.CASCADE,
+ related_name="begin_mail"
+ )
+ almost_end_booking = models.OneToOneField(
+ Booking,
+ null=True,
+ on_delete=models.CASCADE,
+ related_name="warning_mail"
+ )
+ end_booking = models.OneToOneField(
+ Booking,
+ null=True,
+ on_delete=models.CASCADE,
+ related_name="over_mail"
+ )
+