summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/wizards.py
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_warehouse/wizards.py')
-rw-r--r--archaeological_warehouse/wizards.py20
1 files changed, 7 insertions, 13 deletions
diff --git a/archaeological_warehouse/wizards.py b/archaeological_warehouse/wizards.py
index c40894c25..62b441e00 100644
--- a/archaeological_warehouse/wizards.py
+++ b/archaeological_warehouse/wizards.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
-# Copyright (C) 2012 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
+# Copyright (C) 2012-2016 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet>
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
@@ -19,30 +19,24 @@
from django.shortcuts import render_to_response
from django.template import RequestContext
-from django.utils.translation import ugettext_lazy as _
from archaeological_finds.wizards import TreatmentWizard
from archaeological_finds.models import Treatment
class PackagingWizard(TreatmentWizard):
+ basket_step = 'base-packaging'
+
def save_model(self, dct, m2m, whole_associated_models, form_list,
return_object):
dct = self.get_extra_model(dct, form_list)
obj = self.get_current_saved_object()
dct['location'] = dct['container'].location
- items = dct.pop('finds')
+ items = dct.pop('basket')
treatment = Treatment(**dct)
- treatment.save()
- if not hasattr(items, '__iter__'):
- items = [items]
- for item in items:
- new = item.duplicate(self.request.user)
- item.downstream_treatment = treatment
- item.save()
- new.upstream_treatment = treatment
- new.container = dct['container']
- new.save()
+ extra_args_for_new = {"container": dct['container']}
+ treatment.save(items=items, user=self.request.user,
+ extra_args_for_new=extra_args_for_new)
res = render_to_response('ishtar/wizard/wizard_done.html', {},
context_instance=RequestContext(self.request))
return return_object and (obj, res) or res