Browse Source
Site is as functional as before (resolves #47)
Site is as functional as before (resolves #47)
Finished setting up graphs app and getting data from API app. Only issue now is this branch is behind a few commits from other branches.master
Kevin Mok
7 years ago
10 changed files with 53 additions and 57 deletions
-
23api/views.py
-
5graphs/templates/graphs/artist_graph.html
-
1graphs/templates/graphs/features_graphs.html
-
6graphs/templates/graphs/genre_graph.html
-
6graphs/templates/graphs/logged_in.html
-
4graphs/urls.py
-
8graphs/utils.py
-
29graphs/views.py
-
10login/utils.py
-
16login/views.py
@ -0,0 +1,8 @@ |
|||||
|
def get_secret_context(user_secret): |
||||
|
"""Return user_secret in context for graph pages. |
||||
|
|
||||
|
:user_secret: User secret to put in context. |
||||
|
:returns: context with user secret. |
||||
|
|
||||
|
""" |
||||
|
return { 'user_secret': user_secret, } |
@ -0,0 +1,10 @@ |
|||||
|
from .models import User |
||||
|
|
||||
|
def get_user_context(user_obj): |
||||
|
"""Get context for rendering with User's ID and secret. |
||||
|
|
||||
|
:user_obj: User object to make context for. |
||||
|
:returns: context to pass back to HTML file. |
||||
|
|
||||
|
""" |
||||
|
return { 'user_id': user_obj.id, 'user_secret': user_obj.secret, } |
Write
Preview
Loading…
Cancel
Save
Reference in new issue