diff options
author | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-21 15:04:28 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@peacefrogs.net> | 2012-10-21 15:04:28 +0200 |
commit | 038b12ea13407d69fbbe8f0fae3067aa55f1f763 (patch) | |
tree | a8d881b59447269f2e92578cf5924759bad17704 /archaeological_files/wizards.py | |
parent | ea73bf44c5d527f407c89b35b22b21abf2f32617 (diff) | |
download | Ishtar-038b12ea13407d69fbbe8f0fae3067aa55f1f763.tar.bz2 Ishtar-038b12ea13407d69fbbe8f0fae3067aa55f1f763.zip |
Djangoization - Major refactoring (step 8)
* clean-up on request and storage args in methods
* view creation now managed by South
* clean some mess in session values by using MultiValueDict
Diffstat (limited to 'archaeological_files/wizards.py')
-rw-r--r-- | archaeological_files/wizards.py | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/archaeological_files/wizards.py b/archaeological_files/wizards.py index e98248965..0cc34ebcc 100644 --- a/archaeological_files/wizards.py +++ b/archaeological_files/wizards.py @@ -28,7 +28,8 @@ from ishtar_common.wizards import Wizard, ClosingWizard from archaeological_operations.wizards import OperationAdministrativeActWizard,\ AdministrativeActDeletionWizard from ishtar_common.models import Town -from archaeological_operations.models import AdministrativeAct, Parcel +from archaeological_operations.models import AdministrativeAct, Parcel, \ + Operation import models class FileWizard(Wizard): @@ -50,7 +51,7 @@ class FileWizard(Wizard): form = self.get_form_list()[step] town_form_key = 'towns-' + self.url_name if step.startswith('parcels-') and hasattr(form, 'management_form') \ - and self.session_has_key(self.request, self.storage, town_form_key): + and self.session_has_key(town_form_key): towns = [] qdict = self.request.session[self.storage.prefix]['step_data']\ [town_form_key] @@ -132,7 +133,7 @@ class FileDeletionWizard(FileClosingWizard): def get_formated_datas(self, forms): datas = super(FileDeletionWizard, self).get_formated_datas(forms) datas.append((_("Associated operations"), [])) - for operation in models.Operation.objects.filter( + for operation in Operation.objects.filter( associated_file=self.current_obj).all(): if operation.end_date: datas[-1][1].append(('', unicode(operation))) @@ -140,8 +141,7 @@ class FileDeletionWizard(FileClosingWizard): def done(self, form_list, **kwargs): obj = self.get_current_object() - for operation in models.Operation.objects.filter( - associated_file=obj).all(): + for operation in Operation.objects.filter(associated_file=obj).all(): operation.delete() obj.delete() return render_to_response('wizard_done.html', {}, |