Пример #1
0
class User(db.Document):
    correo = db.StringField(required=True, unique=True)
    celular = db.IntField(required=True)
    constrasena = db.StringField(required=True)
    roles = db.ListField(db.ReferenceField('Role',
                                           reverse_delete_rule=db.PULL))

    def hash_password(self):
        self.constrasena = generate_password_hash(
            self.constrasena).decode('utf8')

    def check_password(self, constrasena):
        return check_password_hash(self.constrasena, constrasena)
Пример #2
0
class Institucion(db.Document):
    nombre = db.StringField(required=True, unique=True)
    direccion = db.StringField(required=True)
    descripcion = db.StringField(required=True)
    estado = db.StringField(required=True)
Пример #3
0
class Role(db.Document):
    nombre = db.StringField(required=True, unique=True)
    estado = db.StringField(required=True)
    addid_by = db.ReferenceField('User')
Пример #4
0
class Curso(db.Document):
    nombre = db.StringField(required=True, unique=True)
    descripcion = db.StringField(required=True)
Пример #5
0
class Module(db.Document):
    nombre = db.StringField(required=True, unique=True)
    descripcion = db.StringField(required=True)
    url = db.StringField(required=True)
Пример #6
0
class ReporteIA(db.Document):
    nombre = db.StringField(required=True)
    descripcion = db.StringField(required=True)
    link = db.StringField(required=True)
Пример #7
0
class Persona(db.Document):
    nombre = db.StringField(required=True, unique=True)
    apellidos = db.StringField(required=True)
    DNI = db.StringField(required=True, unique=True)
    codigo_universitario = db.StringField(required=True)
    user_id = db.StringField(required=True)