class User(db.Model, Model): """A user of the blogging application.""" __tablename__ = 'user' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String) email = db.Column(db.String, unique=True) @staticmethod def is_valid_get(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_post(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_patch(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_put(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_delete(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE
class Sports(mixins.CustomizingMixin, db.Model): __tablename__ = 'v_sports' id = db.Column('id_sport', db.Integer, key='id') shortcut = db.Column('short', db.String, primary_key=True, key='shortcut') name = db.Column('sport', db.String, key='name') description = db.Column(db.String)
class Blog(db.Model): """An online weblog.""" __tablename__ = 'blog' id = db.Column(db.Integer, primary_key=True) name = db.Column(db.String) subheader = db.Column(db.String, nullable=True) creator_id = db.Column(db.Integer, db.ForeignKey('user.id')) creator = db.relationship(User)
class Post(db.Model): """An individual blog post.""" __tablename__ = 'post' id = db.Column(db.Integer, primary_key=True) title = db.Column(db.String) content = db.Column(db.String) posted_at = db.Column(db.DateTime, default=datetime.datetime.now) author_id = db.Column(db.Integer, db.ForeignKey('user.id')) author = db.relationship(User)
class Courses(mixins.CustomizingMixin, db.Model): __tablename__ = 'v_subjects' id = db.Column('id_subjects', db.Integer, primary_key=True, key='id') sport = db.Column(db.Integer, db.ForeignKey('v_sports.id')) shortcut = db.Column(db.String) day = db.Column(db.Integer) starts_at = db.Column('begin', db.String, key='starts_at') ends_at = db.Column('end', db.String, key='ends_at') hall = db.Column(db.Integer, db.ForeignKey('v_hall.id')) teacher = db.Column('lector', db.Integer, db.ForeignKey('v_lectors.id'), key='teacher') notice = db.Column(db.String) semester = db.Column(db.Integer)
class t2es(db.Model, Model): """ tablas a ES """ __tablename__ = 't2es' t2es_corr = db.Column(db.Integer, primary_key=True) mand_id = db.Column(db.String(20), unique=True, nullable=False, default='SOCOFIN') dbname = db.Column(db.String(20), unique=True, nullable=False, default='DB_NAME') table_name = db.Column(db.String(40), unique=True, nullable=False) status = db.Column(db.String(1), unique=True, nullable=False, default='I') canal_id = db.Column(db.String(10), unique=True, nullable=False, default='VOZ_OH | VOZ_RBT') negocio_mandante = db.Column(db.String(20),unique=True, nullable=False, default='Ej.: CREDICHILE') orig_id = db.Column(db.String(20),unique=True, nullable=False, default='Ej.: BANCO CHILE') last_i3_identity_ch = db.Column(db.String(40)) last_i3_identity_li = db.Column(db.String(40)) @staticmethod def is_valid_get(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_post(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_patch(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_put(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE @staticmethod def is_valid_delete(request, resource): """Return error message in all cases (just for testing).""" return INVALID_ACTION_MESSAGE
class Enrollments(mixins.CustomizingMixin, db.Model): __tablename__ = 'v_students' id = db.Column('id_student', db.Integer, primary_key=True, key='id') personal_number = db.Column(db.Integer) kos_course_code = db.Column('kos_kod', db.String, key='kos_course_code') course = db.Column('utvs', db.Integer, db.ForeignKey('v_subjects.id'), key='course') semester = db.Column(db.String) registration_date = db.Column(db.DateTime) tour = db.Column(db.Boolean) _kos_code = db.Column('kos_code', db.Boolean, key='_kos_code')
class Teachers(mixins.CustomizingMixin, db.Model): __tablename__ = 'v_lectors' id = db.Column('id_lector', db.Integer, primary_key=True, key='id') degrees_before = db.Column('title_before', db.String, key='degrees_before') first_name = db.Column('name', db.String, key='first_name') last_name = db.Column('surname', db.String, key='last_name') degrees_after = db.Column('title_behind', db.String, key='degrees_after') personal_number = db.Column('pers_number', db.Integer, key='personal_number') url = db.Column(db.String)
class Destinations(mixins.CustomizingMixin, db.Model): __tablename__ = 'v_destination' id = db.Column('id_destination', db.Integer, primary_key=True, key='id') name = db.Column(db.String) url = db.Column(db.String)
class Halls(mixins.CustomizingMixin, db.Model): __tablename__ = 'v_hall' id = db.Column('id_hall', db.Integer, primary_key=True, key='id') name = db.Column(db.String) url = db.Column(db.String)