ticketfrei3/kibicara/platforms/mastodon/model.py

31 lines
754 B
Python

# Copyright (C) 2020 by Thomas Lindner <tom@dl6tom.de>
# Copyright (C) 2020 by Martin Rey <martin.rey@mailbox.org>
#
# SPDX-License-Identifier: 0BSD
from ormantic import ForeignKey, Integer, Text, Boolean, Model
from kibicara.model import Hood, Mapping
class MastodonInstance(Model):
id: Integer(primary_key=True) = None
name: Text()
client_id: Text()
client_secret: Text()
class Mapping(Mapping):
table_name = 'mastodoninstances'
class MastodonAccount(Model):
id: Integer(primary_key=True) = None
hood: ForeignKey(Hood)
instance: ForeignKey(MastodonInstance)
access_token: Text()
enabled: Boolean() = False
last_seen: Text()
class Mapping(Mapping):
table_name = 'mastodonaccounts'