views.py 415 Bytes
Newer Older
1
2
3
4
# standard library imports
from __future__ import absolute_import, print_function
# core django imports
from django.views.generic.base import ContextMixin
5

6
7
8
9
10
11
12
13
14
15

class StudentContextMixin(ContextMixin):
    def get_context_data(self, **kwargs):
        context = super(StudentContextMixin, self).get_context_data(**kwargs)

        me = self.request.user.student

        context['student'] = me

        return context