diff options
Diffstat (limited to 'archaeological_context_records/wizards.py')
-rw-r--r-- | archaeological_context_records/wizards.py | 22 |
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', ] |