Beispiel #1
0
class Messages(db.Model):
    __tablename__ = dbtableprefix + "messages"
    id = db.Column(db.Integer(),
                   db.Sequence(dbtableprefix + 'messages_id_seq'),
                   primary_key=True)
    message = db.Column(db.Text())
    create_time = db.Column(db.DateTime(), server_default=db.func.now())
Beispiel #2
0
class Ticket(db.Model):
    __tablename__ = dbtableprefix + 'ticket'
    id = db.Column(db.Integer(), primary_key=True)
    filename = db.Column(db.String(255))
    request_type = db.Column(db.String(50), nullable=False)
    description = db.Column(db.Text())
    opened_by = db.Column(
        db.Integer(),
        db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE'))
    open_time = db.Column(db.DateTime(), server_default=db.func.now())
    close_time = db.Column(db.DateTime())
    closed_by = db.Column(
        db.Integer(),
        db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE'))
    close_type = db.Column(db.String(50))
    close_description = db.Column(db.Text())
    status = db.Column(db.String(50))
Beispiel #3
0
class TicketNote(db.Model):
    __tablename__ = dbtableprefix + "ticketnote"
    id = db.Column(db.Integer(), primary_key=True)
    user_id = db.Column(
        db.Integer(),
        db.ForeignKey(dbtableprefix + 'user.id', ondelete='CASCADE'))
    note_type = db.Column(db.String(50), nullable=False)
    ticket_id = db.Column(
        db.Integer(),
        db.ForeignKey(dbtableprefix + 'ticket.id', ondelete='CASCADE'))
    create_time = db.Column(db.DateTime(), server_default=db.func.now())
    description = db.Column(db.Text())
Beispiel #4
0
class User(UserMixin, db.Model):
    __tablename__ = dbtableprefix + 'user'
    id = db.Column(db.Integer, primary_key=True)
    social_id = db.Column(db.String(64), nullable=False, unique=True)
    nickname = db.Column(db.String(64), nullable=False)
    email = db.Column(db.String(64), nullable=True, unique=True)
    confirmed_at = db.Column(db.DateTime())
    active = db.Column('active',
                       db.Boolean(),
                       nullable=False,
                       server_default='0')
    first_name = db.Column(db.String(50), nullable=False, server_default='')
    last_name = db.Column(db.String(50), nullable=False, server_default='')
    country = db.Column(db.String(2))
    subdivisionfirst = db.Column(db.String(2))
    subdivisionsecond = db.Column(db.String(50))
    subdivisionthird = db.Column(db.String(50))
    organization = db.Column(db.String(64))
    user_auth = db.relationship('UserAuth',
                                uselist=False,
                                primaryjoin="UserAuth.user_id==User.id")
    roles = db.relationship('Role',
                            secondary='user_roles',
                            backref=db.backref('user', lazy='dynamic'))
Beispiel #5
0
class UserDictLock(db.Model):
    __tablename__ = dbtableprefix + "userdictlock"
    indexno = db.Column(db.Integer(), primary_key=True)
    filename = db.Column(db.Text())
    key = db.Column(db.String(250))
    locktime = db.Column(db.DateTime(), server_default=db.func.now())
Beispiel #6
0
class Supervisors(db.Model):
    __tablename__ = dbtableprefix + "supervisors"
    id = db.Column(db.Integer(), primary_key=True)
    hostname = db.Column(db.Text())
    url = db.Column(db.Text())
    start_time = db.Column(db.DateTime(), server_default=db.func.now())