2022-03-01 16:41:13 +00:00
|
|
|
# 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)
|
2022-03-01 16:53:44 +00:00
|
|
|
instance: ForeignKey(MastodonInstance)
|
2022-03-01 16:41:13 +00:00
|
|
|
access_token: Text()
|
|
|
|
enabled: Boolean() = False
|
|
|
|
last_seen: Text()
|
|
|
|
|
|
|
|
class Mapping(Mapping):
|
|
|
|
table_name = 'mastodonaccounts'
|