Module kibicara.platforms.twitter.model

Expand source code
# Copyright (C) 2020 by Cathy Hu <cathy.hu@fau.de>
#
# SPDX-License-Identifier: 0BSD

from kibicara.model import Hood, Mapping
from ormantic import Boolean, Integer, ForeignKey, Model, Text


class Twitter(Model):
    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    dms_since_id: Integer(allow_null=True) = None
    mentions_since_id: Integer(allow_null=True) = None
    access_token: Text()
    access_token_secret: Text()
    username: Text(allow_null=True) = None
    verified: Boolean() = False
    enabled: Boolean() = False

    class Mapping(Mapping):
        table_name = 'twitterbots'

Classes

class Twitter (**data)

Create a new model by parsing and validating input data from keyword arguments.

Raises ValidationError if the input data cannot be parsed to form a valid model.

Expand source code
class Twitter(Model):
    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    dms_since_id: Integer(allow_null=True) = None
    mentions_since_id: Integer(allow_null=True) = None
    access_token: Text()
    access_token_secret: Text()
    username: Text(allow_null=True) = None
    verified: Boolean() = False
    enabled: Boolean() = False

    class Mapping(Mapping):
        table_name = 'twitterbots'

Ancestors

  • ormantic.models.Model
  • pydantic.main.BaseModel
  • pydantic.utils.Representation

Class variables

var Mapping
var access_token : ormantic.fields.Text
var access_token_secret : ormantic.fields.Text
var dms_since_id : ormantic.fields.Integer
var enabled : ormantic.fields.Boolean
var hood : ormantic.fields.ForeignKey
var id : ormantic.fields.Integer
var mentions_since_id : ormantic.fields.Integer
var username : ormantic.fields.Text
var verified : ormantic.fields.Boolean

Instance variables

var objects
Expand source code
def __get__(self, instance, owner):
    return self.__class__(model_cls=owner)