[email] Add database model

This commit is contained in:
maike 2020-07-05 19:21:40 +02:00 committed by dl6tom
parent 2aab9d3273
commit 4c2d9e63c6
2 changed files with 23 additions and 0 deletions

View file

View file

@ -0,0 +1,23 @@
# Copyright (C) 2020 by Thomas Lindner <tom@dl6tom.de>
#
# SPDX-License-Identifier: 0BSD
from kibicara.model import Hood, Mapping
from ormantic import Integer, ForeignKey, Model, Text, DateTime
class EmailRecipients(Model):
id: Integer(primary_key=True) = None
hood: ForeignKey(Hood)
email: Text()
class Mapping(Mapping):
table_name = 'email_recipients'
class EmailSeen(Model):
id: Integer(primary_key=True) = None
hood: ForeignKey(Hood)
mail_date: DateTime()
class Mapping(Mapping):
table_name = 'email_seen'