csm_web icon indicating copy to clipboard operation
csm_web copied to clipboard

Feat/search bar/backend

Open ElaineShu0312 opened this issue 1 year ago • 0 comments

Implemented search.py, which has the following functionality:

What we can search for, with "query" or "student_absences":

  • student first/last name
  • mentor first/last name
  • student email
  • mentor email
  • student absences (range or exact)

What it should return:

  • all students that match the query
  • the associated sections that have the students in them

E.G. if you query student_absences=4, the JSON will look like:

        {
            "id": 91,
            "spacetimes": [
                {
                    "startTime": "22:48:46.548833",
                    "dayOfWeek": 4,
                    "location": "Moffitt 300",
                    "id": 135,
                    "duration": 3600.0,
                    "override": null
                }
            ],
            "mentor": {
                "id": 91,
                "name": "Matthew Garcia",
                "email": "[[email protected]](mailto:[email protected])",
                "section": 91
            },
            "capacity": 4,
            "associatedProfileId": 2,
            "numStudentsEnrolled": 4,
            "description": "",
            "course": "EECS16B",
            "userRole": "COORDINATOR",
            "courseTitle": "Designing Information Devices and Systems II",
            "courseRestricted": true
        }
    ],"students": [
        {
            "id": 224,
            "name": "Grant Hudson",
            "email": "[[email protected]](mailto:[email protected])",
            "section": 91,
            "mentor": "Matthew Garcia",
            "numAbsences": 4
        }
    ]```
    

ElaineShu0312 avatar Mar 21 '24 04:03 ElaineShu0312