Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
roomlist
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Ross I Kinsey
roomlist
Commits
5ceb42cd
Commit
5ceb42cd
authored
May 26, 2017
by
Daniel W Bond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
created mixin to add 'student' to get_context_data
parent
019961c3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
roomlist/core/views.py
roomlist/core/views.py
+14
-2
No files found.
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