From c29a0b4a982d64b49331303a80826c523f2d35e6 Mon Sep 17 00:00:00 2001 From: Charles Connell Date: Wed, 5 Feb 2014 20:52:54 -0500 Subject: [PATCH] Double nesting won't work --- karmaworld/apps/quizzes/admin.py | 14 +++----------- karmaworld/apps/quizzes/views.py | 3 +-- karmaworld/settings/dev.py | 1 - reqs/common.txt | 1 - 4 files changed, 4 insertions(+), 15 deletions(-) diff --git a/karmaworld/apps/quizzes/admin.py b/karmaworld/apps/quizzes/admin.py index 0012ca7..7bf5712 100644 --- a/karmaworld/apps/quizzes/admin.py +++ b/karmaworld/apps/quizzes/admin.py @@ -2,7 +2,6 @@ # -*- coding:utf8 -*- # Copyright (C) 2014 FinalsClub Foundation from django.contrib import admin -from nested_inlines.admin import NestedModelAdmin, NestedStackedInline, NestedTabularInline from karmaworld.apps.quizzes.models import MultipleChoiceQuestion, FlashCardQuestion, MultipleChoiceOption, Quiz @@ -12,13 +11,7 @@ class MultipleChoiceOptionInlineAdmin(NestedTabularInline): class MultipleChoiceQuestionAdmin(NestedModelAdmin): model = MultipleChoiceQuestion - inlines = [MultipleChoiceOptionInlineAdmin,] - list_display = ('question_text', 'quiz') - - -class MultipleChoiceQuestionInlineAdmin(NestedStackedInline): - model = MultipleChoiceQuestion - inlines = [MultipleChoiceOptionInlineAdmin,] + inlines = [MultipleChoiceOptionInlineAdmin] list_display = ('question_text', 'quiz') @@ -28,9 +21,8 @@ class FlashCardQuestionInlineAdmin(NestedStackedInline): class QuizAdmin(NestedModelAdmin): - #search_fields = ['name', 'note__name'] - #list_display = ('name', 'note') - inlines = [MultipleChoiceQuestionInlineAdmin, FlashCardQuestionInlineAdmin] + search_fields = ['name', 'note__name'] + list_display = ('name', 'note') admin.site.register(Quiz, QuizAdmin) diff --git a/karmaworld/apps/quizzes/views.py b/karmaworld/apps/quizzes/views.py index bda04b7..f3e8702 100644 --- a/karmaworld/apps/quizzes/views.py +++ b/karmaworld/apps/quizzes/views.py @@ -3,8 +3,7 @@ # Copyright (C) 2014 FinalsClub Foundation from itertools import chain -from django.views.generic import TemplateView, DetailView -from django.views.generic.detail import SingleObjectMixin +from django.views.generic import DetailView from karmaworld.apps.quizzes.models import Quiz, ALL_QUESTION_CLASSES diff --git a/karmaworld/settings/dev.py b/karmaworld/settings/dev.py index 232cf4f..a84cf57 100644 --- a/karmaworld/settings/dev.py +++ b/karmaworld/settings/dev.py @@ -60,7 +60,6 @@ INSTALLED_APPS += ( # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings # DEFAULT_FILE_STORAGE comes from karmaworld.secret.static_s3 -STATICFILES_STORAGE = DEFAULT_FILE_STORAGE # See: http://django-storages.readthedocs.org/en/latest/backends/amazon-S3.html#settings AWS_CALLING_FORMAT = CallingFormat.SUBDOMAIN diff --git a/reqs/common.txt b/reqs/common.txt index 0dd59c4..08ec9c8 100644 --- a/reqs/common.txt +++ b/reqs/common.txt @@ -21,5 +21,4 @@ html2text django-allauth boto==2.6.0 django-storages==1.1.4 -git+https://github.com/Soaa-/django-nested-inlines.git django-reversion -- 2.25.1