From 25608b1653e7a113a239d11ffe9d96e6ff2c320e Mon Sep 17 00:00:00 2001 From: Christopher Neugebauer Date: Fri, 2 Sep 2016 14:33:23 +1000 Subject: [PATCH] Moves reports forms into reporting sub package --- registrasion/forms.py | 13 ------------- registrasion/reporting/forms.py | 15 +++++++++++++++ registrasion/reporting/views.py | 3 ++- 3 files changed, 17 insertions(+), 14 deletions(-) create mode 100644 registrasion/reporting/forms.py diff --git a/registrasion/forms.py b/registrasion/forms.py index 2b5ef97b..d6e7878e 100644 --- a/registrasion/forms.py +++ b/registrasion/forms.py @@ -347,16 +347,3 @@ class VoucherForm(forms.Form): help_text="If you have a voucher code, enter it here", required=False, ) - - -# Staff-facing forms. - -class ProductAndCategoryForm(forms.Form): - product = forms.ModelMultipleChoiceField( - queryset=inventory.Product.objects.all(), - required=False, - ) - category = forms.ModelMultipleChoiceField( - queryset=inventory.Category.objects.all(), - required=False, - ) diff --git a/registrasion/reporting/forms.py b/registrasion/reporting/forms.py new file mode 100644 index 00000000..b741e51b --- /dev/null +++ b/registrasion/reporting/forms.py @@ -0,0 +1,15 @@ +from registrasion.models import inventory + +from django import forms + +# Staff-facing forms. + +class ProductAndCategoryForm(forms.Form): + product = forms.ModelMultipleChoiceField( + queryset=inventory.Product.objects.all(), + required=False, + ) + category = forms.ModelMultipleChoiceField( + queryset=inventory.Category.objects.all(), + required=False, + ) diff --git a/registrasion/reporting/views.py b/registrasion/reporting/views.py index d44de514..d6b6261c 100644 --- a/registrasion/reporting/views.py +++ b/registrasion/reporting/views.py @@ -1,3 +1,5 @@ +import forms + from django.contrib.auth.decorators import user_passes_test from django.core.urlresolvers import reverse from django.db import models @@ -6,7 +8,6 @@ from django.db.models import Sum from django.db.models import Case, When, Value from django.shortcuts import render -from registrasion import forms from registrasion.models import commerce from registrasion import views