Esempio n. 1
0
class AllowedImage(db.Model):
    __bind_key__ = 'contacts'
    __tablename__ = 'allowed_images'
    __table_args__ = (db.UniqueConstraint('email'), )

    id = db.Column(db.Integer, primary_key=True)
    email = db.Column(db.String(300))
Esempio n. 2
0
class Contact(db.Model):
    __bind_key__ = 'contacts'
    __tablename__ = 'contacts'
    __table_args__ = (db.UniqueConstraint('email', 'name'), )

    id = db.Column(db.Integer, primary_key=True)

    name = db.Column(db.String(300))
    email = db.Column(db.String(300))

    def to_dict(self):
        return {
            'id': self.id,
            'name': self.name,
            'email': self.email,
        }
Esempio n. 3
0
class FolderCacheItem(db.Model):
    '''
    Store folder UID list and validity.
    '''

    __bind_key__ = 'folders'
    __tablename__ = 'folder_cache_item'
    __table_args__ = (db.UniqueConstraint('account_name', 'folder_name'), )

    id = db.Column(db.Integer, primary_key=True)

    account_name = db.Column(db.String(300), nullable=False)
    folder_name = db.Column(db.String(300), nullable=False)

    uid_validity = db.Column(db.String(300))
    uids = db.Column(db.Text)