Ejemplo n.º 1
0
    def get(self):
        state = request.args.get('state', None)
        licenseType = request.args.get('license_type', 'all')

        userId = get_jwt_identity()
        try:
            userProfessions = UserPrm.getUserParameter(userId,
                                                       'Professions').prm_value
            userProfessions = eval(userProfessions)

            userProfessionSearch = userProfessions["professions"]
            # print("PROFESSIONS ALLOWED: ", userProfessionSearch)
            if userProfessionSearch == "":
                userProfessionSearch = None
        except:
            userProfessionSearch = None

        if state is None and licenseType == 'all':
            # print("LICENSE: ", licenseType)
            record = RecordSchema.getProfessions()
        else:
            # print("LICENSE: ", licenseType)
            record = RecordSchema.getProfesionByLictypeState(
                licenseType=licenseType,
                state=state,
                professions=userProfessionSearch)

        if record:
            test = {key: value for (key, value) in record}

            return test
        return {'message': 'record not found'}, 404
Ejemplo n.º 2
0
 def get(self):
     state = request.args.get('state', None)
     if state is None:
         record = RecordSchema.getProfessions()
     else:
         record = RecordSchema.getProfesionByState(state)
     if record:
         test = {key: value for (key, value) in record}
         return test
     return {'message': 'record not found'}, 404
Ejemplo n.º 3
0
 def get(self):
     record = RecordSchema.getProfessions()
     if record:
         test = {key: value for (key, value) in record}
         return test
     return {'message': 'record not found'}, 404