2020-07-15 21:50:24 +00:00
|
|
|
# Copyright (C) 2020 by Maike <maike@systemli.org>
|
|
|
|
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
|
|
|
|
# Copyright (C) 2020 by Thomas Lindner <tom@dl6tom.de>
|
2020-09-28 22:54:34 +00:00
|
|
|
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
|
2020-07-05 17:21:40 +00:00
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: 0BSD
|
|
|
|
|
2020-10-13 08:35:20 +00:00
|
|
|
from ormantic import ForeignKey, Integer, Model, Text
|
|
|
|
|
2020-07-05 17:21:40 +00:00
|
|
|
from kibicara.model import Hood, Mapping
|
|
|
|
|
|
|
|
|
2020-07-15 21:50:24 +00:00
|
|
|
class Email(Model):
|
2020-10-13 09:38:33 +00:00
|
|
|
"""This table is used to track the names. It also stores the token secret."""
|
2020-07-06 19:26:32 +00:00
|
|
|
|
2020-07-05 17:21:40 +00:00
|
|
|
id: Integer(primary_key=True) = None
|
|
|
|
hood: ForeignKey(Hood)
|
2020-07-15 21:50:24 +00:00
|
|
|
name: Text(unique=True)
|
|
|
|
secret: Text()
|
2020-07-05 17:21:40 +00:00
|
|
|
|
|
|
|
class Mapping(Mapping):
|
2020-07-15 21:50:24 +00:00
|
|
|
table_name = 'email'
|
2020-07-05 17:21:40 +00:00
|
|
|
|
2020-07-05 21:37:01 +00:00
|
|
|
|
2020-07-15 21:50:24 +00:00
|
|
|
class EmailSubscribers(Model):
|
2020-10-13 09:38:33 +00:00
|
|
|
"""This table stores all subscribers, who want to receive messages via email."""
|
2020-07-06 19:26:32 +00:00
|
|
|
|
2020-07-05 17:21:40 +00:00
|
|
|
id: Integer(primary_key=True) = None
|
2020-07-15 21:50:24 +00:00
|
|
|
hood: ForeignKey(Hood)
|
|
|
|
email: Text(unique=True)
|
2020-07-05 17:21:40 +00:00
|
|
|
|
|
|
|
class Mapping(Mapping):
|
2020-07-15 21:50:24 +00:00
|
|
|
table_name = 'email_subscribers'
|