diff options
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) |