summaryrefslogtreecommitdiff
path: root/ishtar_common/wizards.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-30 13:20:53 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2016-11-30 13:20:53 +0100
commit8b666443667f92e014d70a4247c7885375bba610 (patch)
tree7e216f7c036ae568407d46359dea361f2a641098 /ishtar_common/wizards.py
parent62cac0ec03a96d5f358148cf6dff2a21ccf20854 (diff)
downloadIshtar-8b666443667f92e014d70a4247c7885375bba610.tar.bz2
Ishtar-8b666443667f92e014d70a4247c7885375bba610.zip
Simple treatment form. Treatment listing. (refs #3365)
Diffstat (limited to 'ishtar_common/wizards.py')
-rw-r--r--ishtar_common/wizards.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py
index c065459f6..b9fba83b4 100644
--- a/ishtar_common/wizards.py
+++ b/ishtar_common/wizards.py
@@ -126,6 +126,8 @@ class Wizard(NamedUrlWizardView):
current_obj_slug = ''
file_storage = default_storage
+ saved_args = {} # argument to pass on object save
+
'''
# buggy and unecessary...
def __init__(self, *args, **kwargs):
@@ -543,12 +545,16 @@ class Wizard(NamedUrlWizardView):
dct[dependant_item] = c_item
if 'pk' in dct:
dct.pop('pk')
+ saved_args = self.saved_args.copy()
+ for k in saved_args:
+ if k in dct:
+ saved_args[k] = dct.pop(k)
obj = self.get_saved_model()(**dct)
try:
obj.full_clean()
except ValidationError:
return self.render(form_list[-1])
- obj.save()
+ obj.save(**saved_args)
for k in adds:
getattr(obj, k).add(adds[k])
# necessary to manage interaction between models like
@@ -626,6 +632,7 @@ class Wizard(NamedUrlWizardView):
self.request.session[self.current_obj_slug] = unicode(obj.pk)
self.request.session[self.get_object_name(obj)] = unicode(obj.pk)
dct = {'item': obj}
+ self.current_object = obj
# force evaluation of lazy urls
wizard_done_window = unicode(self.wizard_done_window)
if wizard_done_window: