From 04be2c3f89867d2b8ae21ccb475066016bac487d Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Tue, 13 Jun 2017 13:04:16 +0200 Subject: OA code is now a string. --- archaeological_operations/forms.py | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) (limited to 'archaeological_operations/forms.py') diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py index 8fd9233d2..314e184e2 100644 --- a/archaeological_operations/forms.py +++ b/archaeological_operations/forms.py @@ -481,7 +481,8 @@ class OperationSelect(TableSelect): year = forms.IntegerField(label=_("Year")) operation_code = forms.IntegerField(label=_(u"Numeric reference")) if settings.COUNTRY == 'fr': - code_patriarche = forms.IntegerField( + code_patriarche = forms.CharField( + max_length=500, widget=OAWidget, label="Code PATRIARCHE") towns = get_town_field() @@ -769,9 +770,10 @@ class OperationFormGeneral(ManageOldType, forms.Form): } pk = forms.IntegerField(required=False, widget=forms.HiddenInput) if settings.COUNTRY == 'fr': - code_patriarche = forms.IntegerField(label=u"Code PATRIARCHE", - widget=OAWidget, - required=False) + code_patriarche = forms.CharField(label=u"Code PATRIARCHE", + max_length=500, + widget=OAWidget, + required=False) common_name = forms.CharField(label=_(u"Generic name"), required=False, max_length=500, widget=forms.Textarea) address = forms.CharField(label=_(u"Address / Locality"), required=False, @@ -932,7 +934,7 @@ class OperationFormGeneral(ManageOldType, forms.Form): if 'pk' in cleaned_data and cleaned_data['pk']: ops = ops.exclude(pk=cleaned_data['pk']) if ops.count(): - msg = u"Ce code Patriarche a déjà été affecté à une "\ + msg = u"Ce code OA a déjà été affecté à une "\ u"autre opération" raise forms.ValidationError(msg) # manage unique operation ID @@ -1271,7 +1273,8 @@ class OperationSourceSelect(SourceSelect): operation__operation_code = forms.IntegerField( label=_(u"Numeric reference")) if settings.COUNTRY == 'fr': - operation__code_patriarche = forms.IntegerField( + operation__code_patriarche = forms.CharField( + max_length=500, widget=OAWidget, label="Code PATRIARCHE") operation__towns = get_town_field(label=_(u"Operation's town")) @@ -1303,7 +1306,8 @@ class AdministrativeActOpeSelect(TableSelect): if settings.COUNTRY == 'fr': ref_sra = forms.CharField(label=u"Autre référence", max_length=15) - operation__code_patriarche = forms.IntegerField( + operation__code_patriarche = forms.CharField( + max_length=500, widget=OAWidget, label="Code PATRIARCHE") act_type = forms.ChoiceField(label=_("Act type"), choices=[]) -- cgit v1.2.3