diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2014-04-01 20:37:17 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2014-04-01 20:37:48 +0200 |
commit | e25f2b0f735c3a72629f988d9ebfdaa9307c9a4c (patch) | |
tree | b9867b4b895adededac4295a12ea93af3da4c5e8 /archaeological_operations/forms.py | |
parent | 8290d9d47979b7d5d6bd311bec5943d20a7da480 (diff) | |
download | Ishtar-e25f2b0f735c3a72629f988d9ebfdaa9307c9a4c.tar.bz2 Ishtar-e25f2b0f735c3a72629f988d9ebfdaa9307c9a4c.zip |
Add operation code readonly field on operation modification (refs #1730)
Diffstat (limited to 'archaeological_operations/forms.py')
-rw-r--r-- | archaeological_operations/forms.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index bca08230f..cb4b52fe3 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -1,6 +1,6 @@ #!/usr/bin/env python # -*- coding: utf-8 -*- -# Copyright (C) 2010-2013 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2014 Étienne Loks <etienne.loks_AT_peacefrogsDOTnet> # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as @@ -392,6 +392,13 @@ class OperationFormGeneral(forms.Form): raise forms.ValidationError(msg) return self.cleaned_data +class OperationFormModifGeneral(OperationFormGeneral): + operation_code = forms.IntegerField(label=_(u"Operation code"), + initial=models.Operation.get_available_operation_code) + def __init__(self, *args, **kwargs): + super(OperationFormGeneral, self).__init__(*args, **kwargs) + self.fields['operation_code'].widget.attrs['readonly'] = True + class OperationFormPreventive(forms.Form): form_label = _(u"Preventive informations - excavation") cost = forms.IntegerField(label=_(u"Cost (€)"), required=False) |