ticketfrei3/kibicara/platforms/email/model.py

29 lines
766 B
Python
Raw Normal View History

# Copyright (C) 2020 by Maike <tom@dl6tom.de>
2020-07-05 17:21:40 +00:00
#
# SPDX-License-Identifier: 0BSD
from kibicara.model import Hood, Mapping
from ormantic import Integer, ForeignKey, Model, Text
2020-07-05 17:21:40 +00:00
class EmailSubscribers(Model):
""" 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
hood: ForeignKey(Hood)
email: Text()
class Mapping(Mapping):
table_name = 'email_subscribers'
2020-07-05 17:21:40 +00:00
class Email(Model):
""" This table is used to track the hood ID. 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) # this is supposed to be unique - dl6tom/ormantic/pulls/1
secret: Text()
2020-07-05 17:21:40 +00:00
class Mapping(Mapping):
table_name = 'email'