def person_search(): _first_name, _father_name, _dob = request.json["name"], request.json["father_name"], \ Utility.get_date(request.json["dob"]) _first_name = _first_name.lower() _father_name = _father_name.lower() user_found: People = db.session.query(People).filter_by( dob=_dob, father_name=_father_name, first_name=_first_name).first() if user_found is not None: return person_schema.jsonify(user_found) else: return jsonify(Resources.data["error_detail_not_found"])
def person_scan(aadhar_id): person_found = db.session.query(People).filter_by( aadhar_id=aadhar_id).first() return person_schema.jsonify(person_found)
def get_person(_id): person_found = db.session.query(People).filter_by(user_id=_id).first() return person_schema.jsonify(person_found)
def get_person_by_username(_username): person_found = db.session.query(People).filter_by( username=_username).first() return person_schema.jsonify(person_found)
def person_by_token(): token = request.environ['HTTP_AUTHORIZATION'] user_id = Utility.get_payload_from_jwt(token)["id"] person_found = db.session.query(People).filter_by(user_id=user_id).first() return person_schema.jsonify(person_found)