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
commit47f4eaa7509693e0a64ad3ee69b7a312df541127 (patch)
tree5232bf428003effb1dcad3b23c3d49a976c39894 /archaeological_warehouse/forms.py
parentf5a0acf2638ce5bb31e1e9750f30fbc52cae1577 (diff)
downloadIshtar-47f4eaa7509693e0a64ad3ee69b7a312df541127.tar.bz2
Ishtar-47f4eaa7509693e0a64ad3ee69b7a312df541127.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"),