summaryrefslogtreecommitdiff
path: root/archaeological_context_records/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@proxience.com>2015-09-21 23:28:36 +0200
committerÉtienne Loks <etienne.loks@proxience.com>2015-09-21 23:28:36 +0200
commit8eee2250b8f140eb689663a056389f20a966a887 (patch)
tree53df01f8bdeeab4aa94e081a381c2939962f0d66 /archaeological_context_records/wizards.py
parentb1f63beb09085b0a8d7a238d23234d9f44f5d4ed (diff)
downloadIshtar-8eee2250b8f140eb689663a056389f20a966a887.tar.bz2
Ishtar-8eee2250b8f140eb689663a056389f20a966a887.zip
Flake8
Diffstat (limited to 'archaeological_context_records/wizards.py')
-rw-r--r--archaeological_context_records/wizards.py22
1 files changed, 12 insertions, 10 deletions
diff --git a/archaeological_context_records/wizards.py b/archaeological_context_records/wizards.py
index cd48d1308..a51809d32 100644
--- a/archaeological_context_records/wizards.py
+++ b/archaeological_context_records/wizards.py
@@ -17,16 +17,14 @@
# See the file COPYING for details.
-from django.conf import settings
from django.core.exceptions import ObjectDoesNotExist
-from django.shortcuts import render_to_response
-from django.template import RequestContext
from django.utils.translation import ugettext_lazy as _
from ishtar_common.forms import reverse_lazy
from ishtar_common.wizards import Wizard, DeletionWizard, SourceWizard
import models
+
class RecordWizard(Wizard):
model = models.ContextRecord
edit = False
@@ -37,10 +35,11 @@ class RecordWizard(Wizard):
if not step:
return
# manage manualy on creation
- if step.endswith('_creation'): # an operation has been selected
+ if step.endswith('_creation'): # an operation has been selected
main_form_key = 'selec-' + self.url_name
try:
- idx = int(self.session_get_value(main_form_key, 'operation_id'))
+ idx = int(self.session_get_value(
+ main_form_key, 'operation_id'))
current_ope = models.Operation.objects.get(pk=idx)
return current_ope
except(TypeError, ValueError, ObjectDoesNotExist):
@@ -71,12 +70,12 @@ class RecordWizard(Wizard):
data = {}
if not step:
step = self.steps.current
- #step = self.determine_step(request, storage)
+ # step = self.determine_step(request, storage)
form = self.get_form_list()[step]
- general_form_key = 'general-' + self.url_name
+ # general_form_key = 'general-' + self.url_name
if step.startswith('general-'):
- if step.endswith('_creation'): # an operation has been selected
+ if step.endswith('_creation'): # an operation has been selected
main_form_key = 'selec-' + self.url_name
try:
idx = int(self.session_get_value(main_form_key,
@@ -91,10 +90,12 @@ class RecordWizard(Wizard):
form = super(RecordWizard, self).get_form(step, data, files)
return form
+
class RecordModifWizard(RecordWizard):
modification = True
model = models.ContextRecord
+
class RecordDeletionWizard(DeletionWizard):
model = models.ContextRecord
fields = ['label', 'parcel', 'description', 'length', 'width', 'thickness',
@@ -102,10 +103,11 @@ class RecordDeletionWizard(DeletionWizard):
'filling', 'interpretation', 'taq', 'taq_estimated', 'tpq',
'tpq_estimated']
+
class RecordSourceWizard(SourceWizard):
model = models.ContextRecordSource
+
class RecordSourceDeletionWizard(DeletionWizard):
model = models.ContextRecordSource
- fields = ['context_record', 'title', 'source_type', 'authors',]
-
+ fields = ['context_record', 'title', 'source_type', 'authors', ]