Пример #1
0
class Admin(Model):
    id: Integer(primary_key=True) = None
    email: Text(unique=True)
    passhash: Text()

    class Mapping(Mapping):
        table_name = 'admins'
Пример #2
0
class Hood(Model):
    id: Integer(primary_key=True) = None
    name: Text(unique=True)
    landingpage: Text()
    email_enabled: Boolean() = True

    class Mapping(Mapping):
        table_name = 'hoods'
Пример #3
0
class Email(Model):
    """ This table is used to track the names. It also stores the token secret. """

    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    name: Text(unique=True)
    secret: Text()

    class Mapping(Mapping):
        table_name = 'email'
Пример #4
0
class Telegram(Model):
    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    api_token: Text(unique=True)
    welcome_message: Text()
    username: Text(allow_null=True) = None
    enabled: Boolean() = True

    class Mapping(Mapping):
        table_name = 'telegrambots'
Пример #5
0
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'
Пример #6
0
class BadWord(Model):
    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    pattern: Text()

    class Mapping(Mapping):
        table_name = 'badwords'
Пример #7
0
class Trigger(Model):
    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    pattern: Text()

    class Mapping(Mapping):
        table_name = 'triggers'
Пример #8
0
class EmailSubscribers(Model):
    """ This table stores all subscribers, who want to receive messages via email. """

    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    email: Text(unique=True)

    class Mapping(Mapping):
        table_name = 'email_subscribers'