summaryrefslogtreecommitdiff
path: root/archaeological_warehouse/forms.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-20 11:46:57 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2023-01-20 11:46:57 +0100
commitaf04b1ecfc22f8c104f6f960c26086c4284e9777 (patch)
tree5232bf428003effb1dcad3b23c3d49a976c39894 /archaeological_warehouse/forms.py
parent931092752a4db520becea7815e0d1e205b0a921e (diff)
downloadIshtar-af04b1ecfc22f8c104f6f960c26086c4284e9777.tar.bz2
Ishtar-af04b1ecfc22f8c104f6f960c26086c4284e9777.zip
Warehouse: new slug field to prevent ID change when name is changed
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r--archaeological_warehouse/forms.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py
index 828d651f1..a95289669 100644
--- a/archaeological_warehouse/forms.py
+++ b/archaeological_warehouse/forms.py
@@ -23,6 +23,7 @@ import datetime
from django import forms
from django.db.models import Max
from django.conf import settings
+from django.core.validators import validate_slug
from django.forms.formsets import formset_factory
from ishtar_common.utils import ugettext_lazy as _
@@ -201,6 +202,9 @@ class WarehouseForm(CustomForm, ManageOldType, forms.Form):
}
name = forms.CharField(label=_("Name"), max_length=200, validators=[name_validator])
+ slug = forms.CharField(label=_("Textual ID"), max_length=200,
+ validators=[validate_slug], required=False,
+ help_text=_("Auto filled if kept empty."))
warehouse_type = forms.ChoiceField(label=_("Warehouse type"), choices=[])
organization = forms.IntegerField(
label=_("Organization"),