from Main.models import BTZ, TYPE_CHOICES @render_to('studentside/student_btz.html') def student_btz(request): semester = Settings.objects.all()[0].current_semester stream = request.session["current_stream"] btzs = BTZ.objects.filter(specialty=stream.direction.specialty, course=stream.course, study_language=stream.study_language,semester=semester).order_by('type', 'subject', 'department') d = dict(TYPE_CHOICES) for btz in btzs: btz.type = d[btz.type] return {"btzs": btzs}
Oshibka
AttributeError at /student/student_btz/
'NoneType' object has no attribute ‘direction’