Skip to content

Commit

Permalink
enabled training view w/out training itself
Browse files Browse the repository at this point in the history
  • Loading branch information
DahlitzFlorian committed Apr 25, 2017
1 parent 94557b5 commit a8975e9
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
16 changes: 16 additions & 0 deletions vocab/templates/vocab/training.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<!DOCTYPE html>
<head>
<title>Django-Vocab-Trainer</title>
<meta charset="utf-8">
</head>
<body>
<header>
<h1>Django-Vocab-Trainer</h1>
<span id="top-nav">
<a href="{% url 'accounts:auth_logout' %}">Sign out</a>
</span>
</header>
<section>
</section>
</body>
</html>
1 change: 1 addition & 0 deletions vocab/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@

urlpatterns = [
url(r'^$', views.IndexView.as_view(), name="index"),
url(r'^training/(?P<pk>[0-9]+)', views.TrainingView.as_view(), name="training")
]
14 changes: 13 additions & 1 deletion vocab/views.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
from django.shortcuts import render
from django.views import generic

from .models import Learnset


class IndexView(generic.ListView):
"""
Expand All @@ -14,4 +16,14 @@ def get_queryset(self):
"""
Getting queryset for index-page of vocab-app
"""
return []
return Learnset.objects.all().order_by('-creation_date')


class TrainingView(generic.TemplateView):
"""
Shows trainings-session
"""
template_name = 'vocab/training.html'

def get_queryset(self, learnset_id):
pass

0 comments on commit a8975e9

Please sign in to comment.