summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/forms_items.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar/furnitures/forms_items.py')
-rw-r--r--ishtar/furnitures/forms_items.py30
1 files changed, 22 insertions, 8 deletions
diff --git a/ishtar/furnitures/forms_items.py b/ishtar/furnitures/forms_items.py
index 5775731ff..7831d2a8a 100644
--- a/ishtar/furnitures/forms_items.py
+++ b/ishtar/furnitures/forms_items.py
@@ -47,16 +47,31 @@ class ItemWizard(Wizard):
dct['base_items__context_record'] = dct.pop('pk')
return dct
-class ItemFormBase(forms.Form):
- form_label = _("Base item")
+ def save_model(self, *args, **kwargs):
+ print args
+ print kwargs
+ kwargs['return_object'] = True
+ returned, resp = super(ItemWizard, self).save_model(*args, **kwargs)
+ print returned
+ return resp
+
+#class ItemFormBase(forms.Form):
+class ItemForm(forms.Form):
+ form_label = _("Item")
base_model = 'base_items'
- base_items__label = forms.CharField(label=_(u"General ID"),
+ associated_models = {'material_type':models.MaterialType,}
+ base_items__label = forms.CharField(label=_(u"ID"),
validators=[validators.MaxLengthValidator(60)])
- base_items__description = forms.CharField(label=_("General description"),
+ base_items__description = forms.CharField(label=_("Description"),
widget=forms.Textarea)
base_items__is_isolated = forms.NullBooleanField(label=_(u"Is isolated?"),
required=False)
-
+ material_type = forms.ChoiceField(label=_("Material type"),
+ choices=models.MaterialType.get_types())
+ volume = forms.IntegerField(label=_(u"Volume"), required=False)
+ weight = forms.IntegerField(label=_(u"Weight"), required=False)
+ item_number = forms.IntegerField(label=_(u"Item number"), required=False)
+"""
class ItemForm(forms.Form):
form_label = _("Item")
associated_models = {'material_type':models.MaterialType,}
@@ -69,7 +84,7 @@ class ItemForm(forms.Form):
volume = forms.IntegerField(label=_(u"Volume"), required=False)
weight = forms.IntegerField(label=_(u"Weight"), required=False)
item_number = forms.IntegerField(label=_(u"Item number"), required=False)
-
+"""
class DateForm(forms.Form):
form_label = _("Dating")
base_model = 'dating'
@@ -87,8 +102,7 @@ class DateForm(forms.Form):
required=False, choices=models.DatingType.get_types())
item_creation_wizard = ItemWizard([
- ('selecrecord-item_creation', RecordFormSelection),
- ('base_item-record_creation', ItemFormBase),
+ ('selecrecord-item_creation', RecordFormSelection),#('base_item-record_creation', ItemFormBase),
('item-item_creation', ItemForm),
('dating-item_creation', DateForm),
('final-item_creation', FinalForm)],