31 lines
757 B
Python
31 lines
757 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_id: ForeignKey(MastodonInstance)
|
|
access_token: Text()
|
|
enabled: Boolean() = False
|
|
last_seen: Text()
|
|
|
|
class Mapping(Mapping):
|
|
table_name = 'mastodonaccounts'
|