summaryrefslogtreecommitdiff
path: root/archaeological_files/wizards.py
diff options
context:
space:
mode:
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
commitf31f0f269a68b2dfc5c834ce420bb5a02a3ecd0c (patch)
treea8d881b59447269f2e92578cf5924759bad17704 /archaeological_files/wizards.py
parent48eb91979705f9999b724c8e2f960fd7931775c1 (diff)
downloadIshtar-f31f0f269a68b2dfc5c834ce420bb5a02a3ecd0c.tar.bz2
Ishtar-f31f0f269a68b2dfc5c834ce420bb5a02a3ecd0c.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.py10
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', {},