From a4d51b1f2c4268643f10bf2a6f15befbfec27d1b Mon Sep 17 00:00:00 2001 From: "Brian S. Stephan" Date: Sat, 11 Feb 2017 09:37:03 -0600 Subject: [PATCH] remove choices app, everything is in facts now closes bss/dr.botzo#15 --- choices/__init__.py | 0 choices/admin.py | 7 ------ choices/migrations/0001_initial.py | 21 ---------------- choices/migrations/__init__.py | 0 choices/models.py | 20 --------------- .../templates/choices/choiceset_detail.html | 9 ------- choices/templates/choices/index.html | 11 -------- choices/urls.py | 10 -------- choices/views.py | 25 ------------------- dr_botzo/settings.py | 1 - dr_botzo/urls.py | 1 - templates/base.html | 1 - 12 files changed, 106 deletions(-) delete mode 100644 choices/__init__.py delete mode 100644 choices/admin.py delete mode 100644 choices/migrations/0001_initial.py delete mode 100644 choices/migrations/__init__.py delete mode 100644 choices/models.py delete mode 100644 choices/templates/choices/choiceset_detail.html delete mode 100644 choices/templates/choices/index.html delete mode 100644 choices/urls.py delete mode 100644 choices/views.py diff --git a/choices/__init__.py b/choices/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/choices/admin.py b/choices/admin.py deleted file mode 100644 index bfb54f9..0000000 --- a/choices/admin.py +++ /dev/null @@ -1,7 +0,0 @@ -"""Manage choices models.""" - -from django.contrib import admin - -from choices.models import ChoiceSet - -admin.site.register(ChoiceSet) diff --git a/choices/migrations/0001_initial.py b/choices/migrations/0001_initial.py deleted file mode 100644 index ab4a2fe..0000000 --- a/choices/migrations/0001_initial.py +++ /dev/null @@ -1,21 +0,0 @@ -# -*- coding: utf-8 -*- -from __future__ import unicode_literals - -from django.db import migrations, models - - -class Migration(migrations.Migration): - - dependencies = [ - ] - - operations = [ - migrations.CreateModel( - name='ChoiceSet', - fields=[ - ('id', models.AutoField(serialize=False, primary_key=True, verbose_name='ID', auto_created=True)), - ('name', models.CharField(max_length=20)), - ('choices', models.TextField()), - ], - ), - ] diff --git a/choices/migrations/__init__.py b/choices/migrations/__init__.py deleted file mode 100644 index e69de29..0000000 diff --git a/choices/models.py b/choices/models.py deleted file mode 100644 index fcc7bfe..0000000 --- a/choices/models.py +++ /dev/null @@ -1,20 +0,0 @@ -"""Define choice set models""" - -from django.db import models - - -class ChoiceSet(models.Model): - - """Define collections of possible choices.""" - - name = models.CharField(max_length=20) - choices = models.TextField() - - def __str__(self): - """String representation.""" - - return "{0:s} - {1:s}".format(self.name, self.choices) - - def choices_list(self): - """Return choices as a list.""" - return self.choices.split(',') diff --git a/choices/templates/choices/choiceset_detail.html b/choices/templates/choices/choiceset_detail.html deleted file mode 100644 index a689102..0000000 --- a/choices/templates/choices/choiceset_detail.html +++ /dev/null @@ -1,9 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}choice set: {{ choiceset.name }}{% endblock %} - -{% block content %} -

{{ choiceset.name }}

-

Choices: {{ choiceset.choices_list|join:", " }}

-

Random Choice: {{ choiceset.choices_list|random }}

-{% endblock %} diff --git a/choices/templates/choices/index.html b/choices/templates/choices/index.html deleted file mode 100644 index 042f35b..0000000 --- a/choices/templates/choices/index.html +++ /dev/null @@ -1,11 +0,0 @@ -{% extends 'base.html' %} - -{% block title %}choices{% endblock %} - -{% block content %} - -{% endblock %} diff --git a/choices/urls.py b/choices/urls.py deleted file mode 100644 index 57c3970..0000000 --- a/choices/urls.py +++ /dev/null @@ -1,10 +0,0 @@ -"""URL patterns for choices.""" - -from django.conf.urls import url - -from choices.views import index, choiceset_detail - -urlpatterns = [ - url(r'^$', index, name='choices_index'), - url(r'^(?P.+)/$', choiceset_detail, name='choices_choiceset_detail'), -] diff --git a/choices/views.py b/choices/views.py deleted file mode 100644 index ba5a34e..0000000 --- a/choices/views.py +++ /dev/null @@ -1,25 +0,0 @@ -"""Display choice sets.""" - -import logging - -from django.shortcuts import get_object_or_404, render - -from choices.models import ChoiceSet - -log = logging.getLogger(__name__) - - -def index(request): - """Display nothing, for the moment.""" - - choicesets = ChoiceSet.objects.all() - - return render(request, 'choices/index.html', {'choicesets': choicesets}) - - -def choiceset_detail(request, set_name): - """Display info, and a random choice, for the requested choice set.""" - - choiceset = get_object_or_404(ChoiceSet, name=set_name) - - return render(request, 'choices/choiceset_detail.html', {'choiceset': choiceset}) diff --git a/dr_botzo/settings.py b/dr_botzo/settings.py index 770bd36..43f8ad9 100644 --- a/dr_botzo/settings.py +++ b/dr_botzo/settings.py @@ -43,7 +43,6 @@ INSTALLED_APPS = ( 'bootstrap3', 'registration', 'rest_framework', - 'choices', 'countdown', 'dispatch', 'facts', diff --git a/dr_botzo/urls.py b/dr_botzo/urls.py index 145ecd8..193d5eb 100644 --- a/dr_botzo/urls.py +++ b/dr_botzo/urls.py @@ -12,7 +12,6 @@ admin.autodiscover() urlpatterns = [ url(r'^$', TemplateView.as_view(template_name='index.html'), name='home'), - url(r'^choices/', include('choices.urls')), url(r'^dispatch/', include('dispatch.urls')), url(r'^itemsets/', include('facts.urls')), url(r'^karma/', include('karma.urls')), diff --git a/templates/base.html b/templates/base.html index 1f2dd6f..a2f6922 100644 --- a/templates/base.html +++ b/templates/base.html @@ -72,7 +72,6 @@ {% block navbar_menu %}