Exemple #1
0
class TelegramUser(Model):
    id: Integer(primary_key=True) = None
    user_id: Integer(unique=True)
    # TODO unique
    bot: ForeignKey(Telegram)

    class Mapping(Mapping):
        table_name = 'telegramusers'
Exemple #2
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'
Exemple #3
0
class BadWord(Model):
    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    pattern: Text()

    class Mapping(Mapping):
        table_name = 'badwords'
Exemple #4
0
class Trigger(Model):
    id: Integer(primary_key=True) = None
    hood: ForeignKey(Hood)
    pattern: Text()

    class Mapping(Mapping):
        table_name = 'triggers'
Exemple #5
0
class AdminHoodRelation(Model):
    id: Integer(primary_key=True) = None
    admin: ForeignKey(Admin)
    hood: ForeignKey(Hood)

    class Mapping(Mapping):
        table_name = 'admin_hood_relations'
Exemple #6
0
class Admin(Model):
    id: Integer(primary_key=True) = None
    email: Text(unique=True)
    passhash: Text()

    class Mapping(Mapping):
        table_name = 'admins'
Exemple #7
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'
Exemple #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'
Exemple #9
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'
Exemple #10
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'