Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SRCT
roomlist
Commits
5ceb42cd
Commit
5ceb42cd
authored
May 26, 2017
by
Daniel W Bond
Browse files
created mixin to add 'student' to get_context_data
parent
019961c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
roomlist/core/views.py
View file @
5ceb42cd
from
django.shortcuts
import
render
# standard library imports
from
__future__
import
absolute_import
,
print_function
# core django imports
from
django.views.generic.base
import
ContextMixin
# Create your views here.
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment