def updateSeriesAttributes(request):
if request.method == '<STR_LIT:POST>' and request.POST.get('<STR_LIT>'):<EOL><INDENT>series_option = request.POST.get('<STR_LIT>') or None<EOL>seriesClasses = EventOccurrence.objects.filter(event__id=series_option)<EOL>seriesTeachers = SeriesTeacher.objects.filter(event__id=series_option)<EOL><DEDENT>else:<EOL><INDENT>return JsonResponse({})<EOL><DEDENT>outClasses = {}<EOL>for option in seriesClasses:<EOL><INDENT>outClasses[str(option.id)] = option.__str__()<EOL><DEDENT>outTeachers = {}<EOL>for option in seriesTeachers:<EOL><INDENT>outTeachers[str(option.id)] = option.__str__()<EOL><DEDENT>return JsonResponse({<EOL>'<STR_LIT>': outClasses,<EOL>'<STR_LIT>': outTeachers,<EOL>})<EOL>
This function handles the filtering of available series classes and seriesteachers when a series
is chosen on the Substitute Teacher reporting form.