summaryrefslogtreecommitdiff
path: root/app/backend
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-11-03 23:14:58 +0100
committeremkael <emkael@tlen.pl>2016-11-03 23:14:58 +0100
commit94e03b260197122ae8f6d7dfedfb2a191fdae273 (patch)
tree068ce58e2ab24bf4f7c5d9158da7ae4585c66b58 /app/backend
parentd0dc1a56c91a6c257cb5c89286679952f7656ed9 (diff)
* model for mail queue
Diffstat (limited to 'app/backend')
-rw-r--r--app/backend/rcal/model.py21
1 files changed, 19 insertions, 2 deletions
diff --git a/app/backend/rcal/model.py b/app/backend/rcal/model.py
index 4e2644e..61f0047 100644
--- a/app/backend/rcal/model.py
+++ b/app/backend/rcal/model.py
@@ -3,7 +3,7 @@ from sqlalchemy import Column, ForeignKey, Table
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship
from sqlalchemy.types import (TIMESTAMP, Boolean, DateTime, Integer, String,
- TypeDecorator)
+ Text, TypeDecorator)
from sqlalchemy_utils import types
@@ -181,4 +181,21 @@ class UserAuthKey(BASE):
order_by='UserAuthKey.id')
-__all__ = ('Calendar', 'Entry', 'Category', 'User', 'UserAuthKey')
+
+class MailQueue(BASE):
+ __tablename__ = 'mail_queue'
+
+ id = Column(Integer, primary_key=True)
+ subject = Column(String(255))
+ html_body = Column(Text)
+ text_body = Column(Text)
+ recipient_name = Column(String(255))
+ recipient_mail = Column(String(255))
+ is_sent = Column(Boolean, nullable=False,
+ default=False, server_default='0', index=True)
+ send_attempts = Column(Integer, nullable=False,
+ default=0, server_default='0', index=True)
+ create_time = Column(UTCDateTime, index=True)
+ last_attempt_time = Column(UTCDateTime, index=True)
+
+__all__ = ('Calendar', 'Entry', 'Category', 'User', 'UserAuthKey', 'MailQueue')