예제 #1
0
class admin(db.Model):

    id_admin = db.Column(db.Integer, primary_key=True, autoincrement=True)
    first_name = db.Column(db.String(80), nullable=False)
    last_name = db.Column(db.String(80), nullable=False)
    email = db.Column(db.String(255), unique=True, nullable=False)
    password = db.Column(db.String(255))
    date_created = db.Column(db.DateTime, default=db.func.current_timestamp())

    def __repr__(self):
        return f"admin: {self.email}"
예제 #2
0
class user(db.Model):
    id_user = db.Column(db.Integer, primary_key=True, autoincrement=True)
    first_name = db.Column(db.String(80), nullable=False)
    last_name = db.Column(db.String(80), nullable=False)
    birth_date = db.Column(db.DateTime)
    email = db.Column(db.String(255), unique=True, nullable=False)
    genre = db.Column(db.Integer,
                      db.ForeignKey('genre.id_genre'),
                      nullable=False)
    topics_descriptions = db.Column(db.String(140), nullable=False)
    date_created = db.Column(db.DateTime, default=db.func.current_timestamp())

    def __repr__(self):
        return f"user: {self.id_user}"
예제 #3
0
class profile_picture(db.Model):
    id_user = db.Column(db.Integer, primary_key=True, nullable=False)
    id_picture = db.Column(db.Integer, primary_key=True, autoincrement=True)
    url_picture = db.Column(db.String(200), nullable=False)

    def __repr__(self):
        return f"profile_picture: {self.id_user, self.id_picture}"
예제 #4
0
class level(db.Model):
    id_level = db.Column(db.Integer,
                         primary_key=True,
                         nullable=False,
                         autoincrement=True)
    level_description = db.Column(db.String(80), nullable=False)

    def __repr__(self):
        return f"level: {self.id_level}"
예제 #5
0
class language(db.Model):
    id_language = db.Column(db.Integer,
                            primary_key=True,
                            nullable=False,
                            autoincrement=True)
    language_description = db.Column(db.String(80), nullable=False)

    def __repr__(self):
        return f"language: {self.id_language}"
예제 #6
0
class report_type(db.Model):
    id_report_type = db.Column(db.Integer,
                               primary_key=True,
                               nullable=False,
                               autoincrement=True)
    report_type_description = db.Column(db.String(80), nullable=False)

    def __repr__(self):
        return f"report_type: {self.id_report_type}"
예제 #7
0
class report_text(db.Model):
    id_report = db.Column(db.Integer,
                          db.ForeignKey('report.id_report'),
                          primary_key=True,
                          nullable=False,
                          unique=True)
    report_text = db.Column(db.String(50), nullable=False)
    date_created = db.Column(db.DateTime, default=db.func.current_timestamp())

    def __repr__(self):
        return f"report_text: {self.id_report}"
예제 #8
0
class user_status(db.Model):
    id_user = db.Column(db.Integer,
                        db.ForeignKey('user.id_user'),
                        primary_key=True,
                        nullable=False)
    user_status = db.Column(db.String(80), nullable=False, primary_key=True)
    date_created = db.Column(db.DateTime,
                             default=db.func.current_timestamp(),
                             primary_key=True)

    def __repr__(self):
        return f"user_status: {self.user_status}"
예제 #9
0
class feedback(db.Model):
    id_feedback = db.Column(db.Integer,
                            primary_key=True,
                            nullable=False,
                            autoincrement=True)
    id_user_receiver = db.Column(db.Integer,
                                 db.ForeignKey('user.id_user'),
                                 primary_key=True,
                                 nullable=False)
    id_user_giver = db.Column(db.Integer,
                              db.ForeignKey('user.id_user'),
                              primary_key=True,
                              nullable=False)
    date_created = db.Column(db.DateTime, default=db.func.current_timestamp())
    feedback_description = db.Column(db.String(140), nullable=False)

    def __repr__(self):
        return f"feedback: {self.id_feedback}"
예제 #10
0
class fb_user(db.Model):
    fb_user_id = db.Column(db.String(250), primary_key=True, unique=True)
    id_user = db.Column(db.Integer, db.ForeignKey('user.id_user'))

    def __repr__(self):
        return f"user: {self.id_user}"