diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-23 18:45:31 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-12-23 18:45:31 +0100 |
commit | cd421572fcfb1ffc09fc9f7c6c5e4b90182e027f (patch) | |
tree | edf68b05183449abf406ba6eb9e642d77623bb95 /archaeological_warehouse/forms.py | |
parent | 362df5dd42f41237ed1545571704a56db59e4d46 (diff) | |
download | Ishtar-cd421572fcfb1ffc09fc9f7c6c5e4b90182e027f.tar.bz2 Ishtar-cd421572fcfb1ffc09fc9f7c6c5e4b90182e027f.zip |
Container: manage indexes by warehouse (refs #3391)
Diffstat (limited to 'archaeological_warehouse/forms.py')
-rw-r--r-- | archaeological_warehouse/forms.py | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index cd02f12b2..cc21f65f6 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -175,6 +175,16 @@ class ContainerForm(ManageOldType, forms.Form): return new_item +class ContainerModifyForm(ContainerForm): + index = forms.IntegerField(_(u"Index")) + + def __init__(self, *args, **kwargs): + super(ContainerModifyForm, self).__init__(*args, **kwargs) + self.fields.keyOrder.pop(self.fields.keyOrder.index('index')) + self.fields.keyOrder.insert( + self.fields.keyOrder.index("location") + 1, 'index') + ) + class ContainerSelect(TableSelect): location = get_warehouse_field() container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) |