summaryrefslogtreecommitdiff
path: root/ishtar/furnitures/forms.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar/furnitures/forms.py')
-rw-r--r--ishtar/furnitures/forms.py37
1 files changed, 0 insertions, 37 deletions
diff --git a/ishtar/furnitures/forms.py b/ishtar/furnitures/forms.py
index b5d29b7d4..77e2c9b7e 100644
--- a/ishtar/furnitures/forms.py
+++ b/ishtar/furnitures/forms.py
@@ -70,43 +70,6 @@ regexp_name = re.compile(r'^[\w\- ]+$', re.UNICODE)
name_validator = validators.RegexValidator(regexp_name,
_(u"Enter a valid name consisting of letters, spaces and hyphens."), 'invalid')
-class WarehouseForm(forms.Form):
- name = forms.CharField(label=_(u"Name"), max_length=40,
- validators=[name_validator])
- warehouse_type = forms.ChoiceField(label=_(u"Warehouse type"),
- choices=models.WarehouseType.get_types())
- person_in_charge = forms.IntegerField(label=_(u"Person in charge"),
- widget=widgets.JQueryAutoComplete(
- reverse_lazy('autocomplete-person'), associated_model=models.Person),
- validators=[models.valid_id(models.Person)],
- required=False)
- comment = forms.CharField(label=_(u"Comment"), widget=forms.Textarea,
- required=False)
- address = forms.CharField(label=_(u"Address"), widget=forms.Textarea,
- required=False)
- address_complement = forms.CharField(label=_(u"Address complement"),
- widget=forms.Textarea, required=False)
- postal_code = forms.CharField(label=_(u"Postal code"), max_length=10,
- required=False)
- town = forms.CharField(label=_(u"Town"), max_length=30, required=False)
- country = forms.CharField(label=_(u"Country"), max_length=30,
- required=False)
- phone = forms.CharField(label=_(u"Phone"), max_length=18, required=False)
- mobile_phone = forms.CharField(label=_(u"Town"), max_length=18,
- required=False)
-
- def save(self, user):
- dct = self.cleaned_data
- dct['history_modifier'] = user
- dct['warehouse_type'] = models.WarehouseType.objects.get(
- pk=dct['warehouse_type'])
- if 'person_in_charge' in dct and dct['person_in_charge']:
- dct['person_in_charge'] = models.Person.objects.get(
- pk=dct['person_in_charge'])
- new_item = models.Warehouse(**dct)
- new_item.save()
- return new_item
-
class FinalForm(forms.Form):
final = True
form_label = _("Confirm")