From 0733b73040acb07671db25cd4a2cc629020728c5 Mon Sep 17 00:00:00 2001 From: Tom Walker Date: Fri, 4 Jul 2014 15:33:25 +0100 Subject: [PATCH] moved towards CBVs for simples views, next step is to convert complicated views into mix of CBVs and forms with custom validation --- quiz/templates/list_categories.html | 21 ----- quiz/templates/progress.html | 6 +- .../{quiz_index.html => quiz/quiz_list.html} | 0 quiz/templates/view_quiz_category.html | 2 + quiz/tests.py | 13 +-- quiz/urls.py | 13 +-- quiz/views.py | 85 ++++++++++--------- 7 files changed, 59 insertions(+), 81 deletions(-) delete mode 100644 quiz/templates/list_categories.html rename quiz/templates/{quiz_index.html => quiz/quiz_list.html} (100%) diff --git a/quiz/templates/list_categories.html b/quiz/templates/list_categories.html deleted file mode 100644 index 1ae019b..0000000 --- a/quiz/templates/list_categories.html +++ /dev/null @@ -1,21 +0,0 @@ -{% extends 'base.html' %} -{% block title %}All Quizzes{% endblock %} - -{% block content %} -

Category list

- - - -{% endblock %} - -{% block right-sidebar %} -

Sponsored Advertisements

-{% endblock %} diff --git a/quiz/templates/progress.html b/quiz/templates/progress.html index 32c6902..3912f5f 100644 --- a/quiz/templates/progress.html +++ b/quiz/templates/progress.html @@ -14,10 +14,10 @@
+ +
{% endif %} diff --git a/quiz/templates/quiz_index.html b/quiz/templates/quiz/quiz_list.html similarity index 100% rename from quiz/templates/quiz_index.html rename to quiz/templates/quiz/quiz_list.html diff --git a/quiz/templates/view_quiz_category.html b/quiz/templates/view_quiz_category.html index b60a0c9..9d9d555 100644 --- a/quiz/templates/view_quiz_category.html +++ b/quiz/templates/view_quiz_category.html @@ -4,6 +4,7 @@ {% block content %}

Quizzes in {{ category.category }}

+ {% with object_list as quizzes %} {% if quizzes %}