示例#1
0
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"])
示例#2
0
def person_scan(aadhar_id):
    person_found = db.session.query(People).filter_by(
        aadhar_id=aadhar_id).first()
    return person_schema.jsonify(person_found)
示例#3
0
def get_person(_id):
    person_found = db.session.query(People).filter_by(user_id=_id).first()
    return person_schema.jsonify(person_found)
示例#4
0
def get_person_by_username(_username):
    person_found = db.session.query(People).filter_by(
        username=_username).first()
    return person_schema.jsonify(person_found)
示例#5
0
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)