summaryrefslogtreecommitdiff
path: root/archaeological_operations
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-12 15:43:15 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2021-02-28 12:15:24 +0100
commit13b9ef1c26bb89349a15be94db7d01512e270d5a (patch)
treebb7c35ca850f60028c576ee42e3fb95db20a64be /archaeological_operations
parent7e6c628ff9f4d27609efda613b790f87bbeacea1 (diff)
downloadIshtar-13b9ef1c26bb89349a15be94db7d01512e270d5a.tar.bz2
Ishtar-13b9ef1c26bb89349a15be94db7d01512e270d5a.zip
Refactor - clean
Diffstat (limited to 'archaeological_operations')
-rw-r--r--archaeological_operations/admin.py4
-rw-r--r--archaeological_operations/forms.py424
-rw-r--r--archaeological_operations/ishtar_menu.py40
-rw-r--r--archaeological_operations/lookups.py4
-rw-r--r--archaeological_operations/models.py12
-rw-r--r--archaeological_operations/utils.py6
-rw-r--r--archaeological_operations/views.py20
-rw-r--r--archaeological_operations/widgets.py6
-rw-r--r--archaeological_operations/wizards.py5
9 files changed, 261 insertions, 260 deletions
diff --git a/archaeological_operations/admin.py b/archaeological_operations/admin.py
index 312f2c3d3..0650d4711 100644
--- a/archaeological_operations/admin.py
+++ b/archaeological_operations/admin.py
@@ -96,9 +96,9 @@ class AdminOperationForm(forms.ModelForm):
class Meta:
model = models.Operation
exclude = []
- point = PointField(label=_(u"Point"), required=False,
+ point = PointField(label=_("Point"), required=False,
widget=OSMWidget)
- multi_polygon = MultiPolygonField(label=_(u"Multi polygon"), required=False,
+ multi_polygon = MultiPolygonField(label=_("Multi polygon"), required=False,
widget=OSMWidget)
in_charge = AutoCompleteSelectField('person', required=False)
scientist = AutoCompleteSelectField('person', required=False)
diff --git a/archaeological_operations/forms.py b/archaeological_operations/forms.py
index 3714b2e6a..b54a081d8 100644
--- a/archaeological_operations/forms.py
+++ b/archaeological_operations/forms.py
@@ -60,7 +60,7 @@ class ParcelField(forms.MultiValueField):
super(ParcelField, self).__init__(*args, **kwargs)
def compress(self, data_list):
- return u"-".join(data_list)
+ return "-".join(data_list)
class ParcelForm(IshtarForm):
@@ -73,12 +73,12 @@ class ParcelForm(IshtarForm):
year = forms.IntegerField(label=_("Year"), required=False,
validators=[validators.MinValueValidator(1000),
validators.MaxValueValidator(2100)])
- section = forms.CharField(label=_(u"Section"), required=False,
+ section = forms.CharField(label=_("Section"), required=False,
validators=[validators.MaxLengthValidator(4)])
parcel_number = forms.CharField(
- label=_(u"Parcel number"), required=False,
+ label=_("Parcel number"), required=False,
validators=[validators.MaxLengthValidator(6)])
- public_domain = forms.BooleanField(label=_(u"Public domain"),
+ public_domain = forms.BooleanField(label=_("Public domain"),
initial=False, required=False)
def __init__(self, *args, **kwargs):
@@ -122,7 +122,7 @@ class ParcelForm(IshtarForm):
not self.cleaned_data.get('public_domain'):
return {}
if not self.cleaned_data.get('town'):
- raise forms.ValidationError(_(u"Town section is required."))
+ raise forms.ValidationError(_("Town section is required."))
return self.cleaned_data
@classmethod
@@ -193,10 +193,10 @@ class ParcelForm(IshtarForm):
res += " ; "
res += town + u' : '
if c_section:
- res += u" / "
+ res += " / "
c_section = section
res += section + u' '
- res += u", ".join(parcel_numbers)
+ res += ", ".join(parcel_numbers)
if year:
res += " (%s)" % str(year)
return res
@@ -206,10 +206,10 @@ class ParcelSelectionForm(IshtarForm):
_town = forms.ChoiceField(label=_("Town"), choices=(), required=False,
validators=[valid_id(models.Town)])
_parcel_selection = forms.CharField(
- label=_(u"Full text input"),
+ label=_("Full text input"),
widget=SelectParcelWidget(attrs={'class': 'parcel-select'}),
- help_text=_(u"example: \"2013: XD:1 to 13,24,33 to 39, YD:24\" or "
- u"\"AB:24,AC:42\""),
+ help_text=_("example: \"2013: XD:1 to 13,24,33 to 39, YD:24\" or "
+ "\"AB:24,AC:42\""),
max_length=100, required=False)
@@ -373,10 +373,10 @@ class RecordRelationsForm(ManageOldType):
current_related_model = models.Operation
associated_models = {'right_record': models.Operation,
'relation_type': models.RelationType}
- relation_type = forms.ChoiceField(label=_(u"Relation type"),
+ relation_type = forms.ChoiceField(label=_("Relation type"),
choices=[], required=False)
right_record = forms.IntegerField(
- label=_(u"Operation"),
+ label=_("Operation"),
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-operation'),
associated_model=models.Operation),
@@ -398,8 +398,8 @@ class RecordRelationsForm(ManageOldType):
if not nc or nc[-1][0] != rel:
nc.append([rel, []])
nc[-1][1].append(ope)
- rendered = u";".join(
- [u"{}{} {}".format(rel, _(u":"), u" ; ".join(opes))
+ rendered = ";".join(
+ ["{}{} {}".format(rel, _(":"), " ; ".join(opes))
for rel, opes in nc])
return rendered
@@ -407,16 +407,16 @@ class RecordRelationsForm(ManageOldType):
cleaned_data = self.cleaned_data
if (cleaned_data.get('relation_type', None) and
not cleaned_data.get('right_record', None)):
- raise forms.ValidationError(_(u"You should select an operation."))
+ raise forms.ValidationError(_("You should select an operation."))
if (not cleaned_data.get('relation_type', None) and
cleaned_data.get('right_record', None)):
raise forms.ValidationError(
- _(u"You should select a relation type."))
+ _("You should select a relation type."))
if self.left_record and \
str(cleaned_data.get('right_record', None)) == str(
self.left_record.pk):
raise forms.ValidationError(
- _(u"An operation cannot be related to herself."))
+ _("An operation cannot be related to herself."))
return cleaned_data
@classmethod
@@ -448,7 +448,7 @@ class RecordRelationsForm(ManageOldType):
nc[-1][1].append(ope)
result.append((_("Current relations"), cls._format_lst(current)))
if deleted:
- result.append((_("Deleted relations"), u" ; ".join(deleted)))
+ result.append((_("Deleted relations"), " ; ".join(deleted)))
return result
@@ -472,37 +472,37 @@ class RecordRelationsFormSetBase(FormSet):
RecordRelationsFormSet = formset_factory(
RecordRelationsForm, can_delete=True, formset=RecordRelationsFormSetBase)
-RecordRelationsFormSet.form_label = _(u"Relations")
-RecordRelationsFormSet.form_admin_name = _(u"Operation - 080 - Relations")
+RecordRelationsFormSet.form_label = _("Relations")
+RecordRelationsFormSet.form_admin_name = _("Operation - 080 - Relations")
RecordRelationsFormSet.form_slug = "operation-080-relations"
class OperationSelect(DocumentItemSelect):
_model = models.Operation
- form_admin_name = _(u"Operation - 001 - Search")
+ form_admin_name = _("Operation - 001 - Search")
form_slug = "operation-001-search"
search_vector = forms.CharField(
- label=_(u"Full text search"), widget=widgets.SearchWidget(
+ label=_("Full text search"), widget=widgets.SearchWidget(
'archaeological-operations', 'operation'))
year = forms.IntegerField(label=_("Year"))
- operation_code = forms.IntegerField(label=_(u"Numeric reference"))
+ operation_code = forms.IntegerField(label=_("Numeric reference"))
code_patriarche = forms.CharField(
max_length=500,
widget=OAWidget,
label="Code PATRIARCHE")
drassm_code = forms.CharField(
- label=_(u"DRASSM code"), required=False, max_length=100)
+ label=_("DRASSM code"), required=False, max_length=100)
towns = get_town_field()
towns__areas = forms.ChoiceField(label=_("Areas"), choices=[])
- parcel = forms.CharField(label=_(u"Parcel"))
+ parcel = forms.CharField(label=_("Parcel"))
if settings.ISHTAR_DPTS:
towns__numero_insee__startswith = forms.ChoiceField(
- label=_(u"Department"), choices=[])
- common_name = forms.CharField(label=_(u"Name"), max_length=30)
- address = forms.CharField(label=_(u"Address / Locality"), max_length=100)
- operation_type = forms.ChoiceField(label=_(u"Operation type"), choices=[])
- end_date = forms.NullBooleanField(label=_(u"Is open?"))
+ label=_("Department"), choices=[])
+ common_name = forms.CharField(label=_("Name"), max_length=30)
+ address = forms.CharField(label=_("Address / Locality"), max_length=100)
+ operation_type = forms.ChoiceField(label=_("Operation type"), choices=[])
+ end_date = forms.NullBooleanField(label=_("Is open?"))
in_charge = forms.IntegerField(
widget=widgets.JQueryAutoComplete(
reverse_lazy(
@@ -510,14 +510,14 @@ class OperationSelect(DocumentItemSelect):
args=[person_type_pks_lazy(['sra_agent'])]
),
associated_model=Person),
- label=_(u"In charge"))
+ label=_("In charge"))
scientist = forms.IntegerField(
widget=widgets.JQueryAutoComplete(
reverse_lazy(
'autocomplete-person-permissive',
args=[person_type_pks_lazy(['sra_agent', 'head_scientist'])]),
associated_model=Person),
- label=_(u"Scientist in charge"))
+ label=_("Scientist in charge"))
operator = forms.IntegerField(
label=_("Operator"),
widget=widgets.JQueryAutoComplete(
@@ -526,24 +526,24 @@ class OperationSelect(DocumentItemSelect):
args=[organization_type_pks_lazy(['operator'])]),
associated_model=Organization),
validators=[valid_id(Organization)])
- # operator_reference = forms.CharField(label=_(u"Operator reference"),
+ # operator_reference = forms.CharField(label=_("Operator reference"),
# max_length=20)
- remains = forms.ChoiceField(label=_(u"Remains"), choices=[])
- periods = forms.ChoiceField(label=_(u"Periods"), choices=[])
- start_before = DateField(label=_(u"Started before"))
- start_after = DateField(label=_(u"Started after"))
- end_before = DateField(label=_(u"Ended before"))
- end_after = DateField(label=_(u"Ended after"))
+ remains = forms.ChoiceField(label=_("Remains"), choices=[])
+ periods = forms.ChoiceField(label=_("Periods"), choices=[])
+ start_before = DateField(label=_("Started before"))
+ start_after = DateField(label=_("Started after"))
+ end_before = DateField(label=_("Ended before"))
+ end_after = DateField(label=_("Ended after"))
relation_types = forms.ChoiceField(
- label=_(u"Search within relations"), choices=[])
- comment = forms.CharField(label=_(u"Comment"), max_length=500)
- abstract = forms.CharField(label=_(u"Abstract (full text search)"))
+ label=_("Search within relations"), choices=[])
+ comment = forms.CharField(label=_("Comment"), max_length=500)
+ abstract = forms.CharField(label=_("Abstract (full text search)"))
scientific_documentation_comment = forms.CharField(
- label=_(u"Comment about scientific documentation"))
- record_quality_type = forms.ChoiceField(label=_(u"Record quality"))
- report_processing = forms.ChoiceField(label=_(u"Report processing"),
+ label=_("Comment about scientific documentation"))
+ record_quality_type = forms.ChoiceField(label=_("Record quality"))
+ report_processing = forms.ChoiceField(label=_("Report processing"),
choices=[])
- virtual_operation = forms.NullBooleanField(label=_(u"Virtual operation"))
+ virtual_operation = forms.NullBooleanField(label=_("Virtual operation"))
archaeological_sites = forms.IntegerField(
label=_("Archaeological site"),
widget=widgets.JQueryAutoComplete(
@@ -551,31 +551,31 @@ class OperationSelect(DocumentItemSelect):
associated_model=models.ArchaeologicalSite),
validators=[valid_id(models.ArchaeologicalSite)])
history_creator = forms.IntegerField(
- label=_(u"Created by"),
+ label=_("Created by"),
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-person', args=['0', 'user']),
associated_model=Person),
validators=[valid_id(Person)])
history_modifier = forms.IntegerField(
- label=_(u"Modified by"),
+ label=_("Modified by"),
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-person',
args=['0', 'user']),
associated_model=Person),
validators=[valid_id(Person)])
documentation_received = forms.NullBooleanField(
- label=_(u"Documentation received"))
+ label=_("Documentation received"))
documentation_deadline_before = DateField(
- label=_(u"Documentation deadline before"))
+ label=_("Documentation deadline before"))
documentation_deadline_after = DateField(
- label=_(u"Documentation deadline after"))
+ label=_("Documentation deadline after"))
has_finds = forms.NullBooleanField(label=_("Has finds"))
finds_received = forms.NullBooleanField(
- label=_(u"Finds received"))
+ label=_("Finds received"))
finds_deadline_before = DateField(
- label=_(u"Finds deadline before"))
+ label=_("Finds deadline before"))
finds_deadline_after = DateField(
- label=_(u"Finds deadline after"))
+ label=_("Finds deadline after"))
TYPES = [
FieldType('operation_type', models.OperationType),
@@ -608,7 +608,7 @@ class OperationSelect(DocumentItemSelect):
class OperationFormSelection(LockForm, CustomFormSearch):
SEARCH_AND_SELECT = True
- form_label = _(u"Operation search")
+ form_label = _("Operation search")
associated_models = {'pk': models.Operation}
extra_form_modals = ["person", "organization"]
currents = {'pk': models.Operation}
@@ -622,7 +622,7 @@ class OperationFormSelection(LockForm, CustomFormSearch):
class OperationFormMultiSelection(LockForm, MultiSearchForm):
- form_label = _(u"Operation search")
+ form_label = _("Operation search")
associated_models = {'pks': models.Operation}
extra_form_modals = ["person", "organization"]
pk_key = 'pks'
@@ -642,7 +642,7 @@ class OperationCodeInput(forms.TextInput):
name, value = args
base_name = '-'.join(name.split('-')[:-1])
rendered = super(OperationCodeInput, self).render(*args, **kwargs)
- js = u"""\n <script type="text/javascript"><!--//
+ js = """\n <script type="text/javascript"><!--//
function initialyse_operation_code () {
// if the form is in creation mode
if(!$("#id_%(base_name)s-pk").val()){
@@ -663,33 +663,33 @@ class OperationCodeInput(forms.TextInput):
class OperationFormFileChoice(IshtarForm):
- form_label = _(u"Associated file")
+ form_label = _("Associated file")
associated_models = {'associated_file': File, }
currents = {'associated_file': File}
associated_file = forms.IntegerField(
- label=_(u"Archaeological file"),
+ label=_("Archaeological file"),
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-file'), associated_model=File),
validators=[valid_id(File)], required=False)
class OperationFormAbstract(CustomForm, IshtarForm):
- form_label = _(u"Abstract")
- form_admin_name = _(u"Operation - 090 - Abstract")
+ form_label = _("Abstract")
+ form_admin_name = _("Operation - 090 - Abstract")
form_slug = "operation-090-abstract"
abstract = forms.CharField(
- label=_(u"Abstract"),
+ label=_("Abstract"),
widget=forms.Textarea(attrs={'class': 'xlarge'}), required=False)
-SLICING = (("month", _(u"months")), ('year', _(u"years")),)
+SLICING = (("month", _("months")), ('year', _("years")),)
-DATE_SOURCE = (('creation', _(u"Creation date")),
- ("start", _(u"Start of field work")))
+DATE_SOURCE = (('creation', _("Creation date")),
+ ("start", _("Start of field work")))
PREVENTIVE_RESARCH = (('all', _('All')),
- ('preventive', _(u"Preventive")),
- ('research', _(u"Research")),)
+ ('preventive', _("Preventive")),
+ ('research', _("Research")),)
class DashboardForm(IshtarForm):
@@ -706,8 +706,8 @@ class DashboardForm(IshtarForm):
required=False)
operator = forms.ChoiceField(label=_("Operator"), choices=[],
required=False)
- after = DateField(label=_(u"Date after"), required=False)
- before = DateField(label=_(u"Date before"), required=False)
+ after = DateField(label=_("Date after"), required=False)
+ before = DateField(label=_("Date before"), required=False)
with_report = forms.BooleanField(label=_("With reports"), required=False)
with_finds = forms.BooleanField(label=_("With finds"), required=False)
@@ -762,8 +762,8 @@ class DashboardForm(IshtarForm):
class OperationFormGeneral(CustomForm, ManageOldType):
HEADERS = {}
- form_label = _(u"General")
- form_admin_name = _(u"Operation - 010 - General")
+ form_label = _("General")
+ form_admin_name = _("Operation - 010 - General")
form_slug = "operation-010-general"
extra_form_modals = ["person", "organization"]
@@ -779,19 +779,19 @@ class OperationFormGeneral(CustomForm, ManageOldType):
'spatial_reference_system': SpatialReferenceSystem,
}
pk = forms.IntegerField(required=False, widget=forms.HiddenInput)
- code_patriarche = forms.CharField(label=u"Code PATRIARCHE",
+ code_patriarche = forms.CharField(label="Code PATRIARCHE",
max_length=500,
widget=OAWidget,
required=False)
drassm_code = forms.CharField(
- label=_(u"DRASSM code"), required=False, max_length=100)
- operation_type = forms.ChoiceField(label=_(u"Operation type"),
+ label=_("DRASSM code"), required=False, max_length=100)
+ operation_type = forms.ChoiceField(label=_("Operation type"),
choices=[])
- common_name = forms.CharField(label=_(u"Generic name"), required=False,
+ common_name = forms.CharField(label=_("Generic name"), required=False,
max_length=500, widget=forms.Textarea)
- address = forms.CharField(label=_(u"Address / Locality"), required=False,
+ address = forms.CharField(label=_("Address / Locality"), required=False,
max_length=500, widget=forms.Textarea)
- year = forms.IntegerField(label=_(u"Year"),
+ year = forms.IntegerField(label=_("Year"),
initial=lambda: datetime.datetime.now().year,
validators=[validators.MinValueValidator(1000),
validators.MaxValueValidator(2100)])
@@ -820,7 +820,7 @@ class OperationFormGeneral(CustomForm, ManageOldType):
tips=lazy(get_operator_label),
associated_model=Organization, new=True),
validators=[valid_id(Organization)], required=False)
- operator_reference = forms.CharField(label=_(u"Operator reference"),
+ operator_reference = forms.CharField(label=_("Operator reference"),
required=False, max_length=20)
in_charge = forms.IntegerField(
label=_("In charge"),
@@ -838,12 +838,12 @@ class OperationFormGeneral(CustomForm, ManageOldType):
label=_("Total surface (m2)"),
validators=[validators.MinValueValidator(0),
validators.MaxValueValidator(999999999)])
- start_date = DateField(label=_(u"Start date"), required=False)
- excavation_end_date = DateField(label=_(u"Excavation end date"),
+ start_date = DateField(label=_("Start date"), required=False)
+ excavation_end_date = DateField(label=_("Excavation end date"),
required=False)
- report_delivery_date = DateField(label=_(u"Report delivery date"),
+ report_delivery_date = DateField(label=_("Report delivery date"),
required=False)
- report_processing = forms.ChoiceField(label=_(u"Report processing"),
+ report_processing = forms.ChoiceField(label=_("Report processing"),
choices=[], required=False)
if settings.COUNTRY == 'fr':
cira_date = DateField(label="Date avis CTRA/CIRA", required=False)
@@ -947,13 +947,13 @@ class OperationFormGeneral(CustomForm, ManageOldType):
and cleaned_data.get('excavation_end_date', None):
if not cleaned_data.get('start_date', None):
raise forms.ValidationError(
- _(u"If you want to set an excavation end date you "
- u"have to provide a start date."))
+ _("If you want to set an excavation end date you "
+ "have to provide a start date."))
if cleaned_data['excavation_end_date'] \
< cleaned_data['start_date']:
raise forms.ValidationError(
- _(u"The excavation end date cannot be before the start "
- u"date."))
+ _("The excavation end date cannot be before the start "
+ "date."))
# verify patriarche
code_p = self.cleaned_data.get('code_patriarche', None)
@@ -963,8 +963,8 @@ class OperationFormGeneral(CustomForm, ManageOldType):
if 'pk' in cleaned_data and cleaned_data['pk']:
ops = ops.exclude(pk=cleaned_data['pk'])
if ops.count():
- msg = u"Ce code OA a déjà été affecté à une "\
- u"autre opération"
+ msg = "Ce code OA a déjà été affecté à une "\
+ "autre opération"
raise forms.ValidationError(msg)
# manage unique operation ID
@@ -982,21 +982,21 @@ class OperationFormGeneral(CustomForm, ManageOldType):
Max('operation_code'))["operation_code__max"]
if year and max_val:
msg = _(
- u"Operation code already exists for year: %(year)d - use a "
- u"value bigger than %(last_val)d") % {
+ "Operation code already exists for year: %(year)d - use a "
+ "value bigger than %(last_val)d") % {
'year': year, 'last_val': max_val}
else:
- msg = _(u"Bad operation code")
+ msg = _("Bad operation code")
raise forms.ValidationError(msg)
return self.cleaned_data
class OperationFormModifGeneral(OperationFormGeneral):
- operation_code = forms.IntegerField(label=_(u"Operation code"),
+ operation_code = forms.IntegerField(label=_("Operation code"),
required=False)
currents = {'associated_file': File}
associated_file = forms.IntegerField(
- label=_(u"Archaeological file"),
+ label=_("Archaeological file"),
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-file'),
associated_model=File),
@@ -1038,16 +1038,16 @@ class CourtOrderedSeizureForm(CustomForm, IshtarForm):
}
seizure_name = forms.CharField(
- label=_(u"Seizure name"), required=False,
+ label=_("Seizure name"), required=False,
)
official_report_number = forms.CharField(
- label=_(u"Official report number"), required=False,
+ label=_("Official report number"), required=False,
)
protagonist = forms.IntegerField(
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-person-permissive'),
associated_model=Person, new=True),
- label=_(u"Protagonist"), required=False,
+ label=_("Protagonist"), required=False,
)
applicant_authority = forms.IntegerField(
widget=widgets.JQueryAutoComplete(
@@ -1064,8 +1064,8 @@ class CourtOrderedSeizureForm(CustomForm, IshtarForm):
class CollaboratorForm(CustomForm, IshtarForm):
- form_label = _(u"Collaborators")
- form_admin_name = _(u"Operation - 020 - Collaborators")
+ form_label = _("Collaborators")
+ form_admin_name = _("Operation - 020 - Collaborators")
form_slug = "operation-020-collaborators"
base_models = ['collaborator']
@@ -1080,37 +1080,37 @@ class CollaboratorForm(CustomForm, IshtarForm):
class OperationFormPreventive(CustomForm, IshtarForm):
- form_label = _(u"Preventive informations - excavation")
- form_admin_name = _(u"Operation - 033 - Preventive - Excavation")
+ form_label = _("Preventive informations - excavation")
+ form_admin_name = _("Operation - 033 - Preventive - Excavation")
form_slug = "operation-033-preventive-excavation"
- cost = forms.IntegerField(label=_(u"Cost (euros)"), required=False)
- scheduled_man_days = forms.IntegerField(label=_(u"Scheduled man-days"),
+ cost = forms.IntegerField(label=_("Cost (euros)"), required=False)
+ scheduled_man_days = forms.IntegerField(label=_("Scheduled man-days"),
required=False)
- optional_man_days = forms.IntegerField(label=_(u"Optional man-days"),
+ optional_man_days = forms.IntegerField(label=_("Optional man-days"),
required=False)
- effective_man_days = forms.IntegerField(label=_(u"Effective man-days"),
+ effective_man_days = forms.IntegerField(label=_("Effective man-days"),
required=False)
if settings.COUNTRY == 'fr':
fnap_financing = forms.FloatField(
- required=False, label=u"Pourcentage de financement FNAP",
+ required=False, label="Pourcentage de financement FNAP",
validators=[validators.MinValueValidator(0),
validators.MaxValueValidator(100)])
class OperationFormPreventiveDiag(CustomForm, IshtarForm):
form_label = _("Preventive informations - diagnostic")
- form_admin_name = _(u"Operation - 037 - Preventive - Diagnostic")
+ form_admin_name = _("Operation - 037 - Preventive - Diagnostic")
form_slug = "operation-037-preventive-diagnostic"
if settings.COUNTRY == 'fr':
zoning_prescription = forms.NullBooleanField(
- required=False, label=_(u"Prescription on zoning"))
+ required=False, label=_("Prescription on zoning"))
large_area_prescription = forms.NullBooleanField(
- required=False, label=_(u"Prescription on large area"))
+ required=False, label=_("Prescription on large area"))
geoarchaeological_context_prescription = forms.NullBooleanField(
required=False,
- label=_(u"Prescription on geoarchaeological context"))
+ label=_("Prescription on geoarchaeological context"))
class SelectedTownForm(IshtarForm):
@@ -1130,13 +1130,13 @@ class SelectedTownForm(IshtarForm):
SelectedTownFormset = formset_factory(SelectedTownForm, can_delete=True,
formset=TownFormSet)
-SelectedTownFormset.form_label = _(u"Towns")
-SelectedTownFormset.form_admin_name = _(u"Operation - 040 - Towns")
+SelectedTownFormset.form_label = _("Towns")
+SelectedTownFormset.form_admin_name = _("Operation - 040 - Towns")
SelectedTownFormset.form_slug = "operation-040-towns"
TownFormset = formset_factory(TownForm, can_delete=True, formset=TownFormSet)
TownFormset.form_label = _("Towns")
-TownFormset.form_admin_name = _(u"Operation - 040 - Towns (2)")
+TownFormset.form_admin_name = _("Operation - 040 - Towns (2)")
TownFormset.form_slug = "operation-040-towns-2"
@@ -1158,14 +1158,14 @@ class SelectedParcelForm(IshtarForm):
SelectedParcelFormSet = formset_factory(SelectedParcelForm, can_delete=True,
formset=ParcelFormSet)
SelectedParcelFormSet.form_label = _("Parcels")
-SelectedParcelFormSet.form_admin_name = _(u"Operation - 050 - Parcels")
+SelectedParcelFormSet.form_admin_name = _("Operation - 050 - Parcels")
SelectedParcelFormSet.form_slug = "operation-050-parcels"
SelectedParcelGeneralFormSet = formset_factory(ParcelForm, can_delete=True,
formset=ParcelFormSet)
SelectedParcelGeneralFormSet.form_label = _("Parcels")
SelectedParcelGeneralFormSet.form_admin_name = _(
- u"Operation - 050 - Parcels (2)")
+ "Operation - 050 - Parcels (2)")
SelectedParcelGeneralFormSet.form_slug = "operation-050-parcels-2"
"""
@@ -1195,14 +1195,14 @@ class SelectedParcelFormSet(forms.Form):
class RemainForm(CustomForm, ManageOldType, forms.Form):
- form_label = _(u"Remain types")
- form_admin_name = _(u"Operation - 060 - Remains")
+ form_label = _("Remain types")
+ form_admin_name = _("Operation - 060 - Remains")
form_slug = "operation-060-remains"
base_model = 'remain'
associated_models = {'remain': models.RemainType}
remain = widgets.Select2MultipleField(
- label=_(u"Remain type"), required=False
+ label=_("Remain type"), required=False
)
TYPES = [
@@ -1211,14 +1211,14 @@ class RemainForm(CustomForm, ManageOldType, forms.Form):
class PeriodForm(CustomForm, ManageOldType, forms.Form):
- form_label = _(u"Periods")
- form_admin_name = _(u"Operation - 070 - Periods")
+ form_label = _("Periods")
+ form_admin_name = _("Operation - 070 - Periods")
form_slug = "operation-070-periods"
base_model = 'period'
associated_models = {'period': models.Period}
period = widgets.Select2MultipleField(
- label=_(u"Period"), required=False
+ label=_("Period"), required=False
)
TYPES = [
@@ -1231,9 +1231,9 @@ class ArchaeologicalSiteForm(ManageOldType):
'cultural_attribution': models.CulturalAttributionType,
'spatial_reference_system': SpatialReferenceSystem}
HEADERS = {}
- reference = forms.CharField(label=_(u"Reference"), max_length=200)
- name = forms.CharField(label=_(u"Name"), max_length=200, required=False)
- other_reference = forms.CharField(label=_(u"Other reference"),
+ reference = forms.CharField(label=_("Reference"), max_length=200)
+ name = forms.CharField(label=_("Name"), max_length=200, required=False)
+ other_reference = forms.CharField(label=_("Other reference"),
required=False)
periods = forms.MultipleChoiceField(
label=_("Periods"), choices=[], widget=widgets.Select2Multiple,
@@ -1245,18 +1245,18 @@ class ArchaeologicalSiteForm(ManageOldType):
label=_("Cultural attributions"), choices=[],
widget=widgets.Select2Multiple,
required=False)
- HEADERS['x'] = FormHeader(_(u"Coordinates"))
- x = forms.FloatField(label=_(u"X"), required=False)
- estimated_error_x = forms.FloatField(label=_(u"Estimated error for X"),
+ HEADERS['x'] = FormHeader(_("Coordinates"))
+ x = forms.FloatField(label=_("X"), required=False)
+ estimated_error_x = forms.FloatField(label=_("Estimated error for X"),
required=False)
- y = forms.FloatField(label=_(u"Y"), required=False)
- estimated_error_y = forms.FloatField(label=_(u"Estimated error for Y"),
+ y = forms.FloatField(label=_("Y"), required=False)
+ estimated_error_y = forms.FloatField(label=_("Estimated error for Y"),
required=False)
- z = forms.FloatField(label=_(u"Z"), required=False)
- estimated_error_z = forms.FloatField(label=_(u"Estimated error for Z"),
+ z = forms.FloatField(label=_("Z"), required=False)
+ estimated_error_z = forms.FloatField(label=_("Estimated error for Z"),
required=False)
spatial_reference_system = forms.ChoiceField(
- label=_(u"Spatial Reference System"), required=False, choices=[])
+ label=_("Spatial Reference System"), required=False, choices=[])
PROFILE_FILTER = {
'mapping': [
@@ -1287,7 +1287,7 @@ class ArchaeologicalSiteForm(ManageOldType):
reference = self.cleaned_data['reference']
if models.ArchaeologicalSite.objects\
.filter(reference=reference).count():
- raise forms.ValidationError(_(u"This reference already exists."))
+ raise forms.ValidationError(_("This reference already exists."))
return reference
def save(self, user):
@@ -1345,9 +1345,9 @@ class ArchaeologicalSiteBasicForm(widgets.Select2Media, IshtarForm):
ArchaeologicalSiteFormSet = formset_factory(
ArchaeologicalSiteBasicForm, can_delete=True, formset=FormSet)
-ArchaeologicalSiteFormSet.form_label = _(u"Archaeological sites")
+ArchaeologicalSiteFormSet.form_label = _("Archaeological sites")
ArchaeologicalSiteFormSet.form_admin_name = _(
- u"Operation - 030 - Archaeological sites")
+ "Operation - 030 - Archaeological sites")
ArchaeologicalSiteFormSet.form_slug = "operation-030-archaeological-sites"
ArchaeologicalSiteFormSet.extra_form_modals = ["archaeologicalsite"]
@@ -1360,17 +1360,17 @@ class ArchaeologicalSiteSelectionForm(IshtarForm):
reverse_lazy('autocomplete-archaeologicalsite'),
associated_model=models.ArchaeologicalSite, new=True,
multiple=True),
- label=_(u"Search"))
+ label=_("Search"))
class FinalOperationClosingForm(FinalForm):
confirm_msg = " "
- confirm_end_msg = _(u"Would you like to close this operation?")
+ confirm_end_msg = _("Would you like to close this operation?")
class OperationDeletionForm(FinalForm):
confirm_msg = " "
- confirm_end_msg = _(u"Would you like to delete this operation?")
+ confirm_end_msg = _("Would you like to delete this operation?")
#########
# Sites #
@@ -1379,60 +1379,60 @@ class OperationDeletionForm(FinalForm):
class SiteSelect(DocumentItemSelect):
_model = models.ArchaeologicalSite
- form_admin_name = _(u"Archaeological site - 001 - Search")
+ form_admin_name = _("Archaeological site - 001 - Search")
form_slug = "archaeological_site-001-search"
search_vector = forms.CharField(
- label=_(u"Full text search"), widget=widgets.SearchWidget(
+ label=_("Full text search"), widget=widgets.SearchWidget(
'archaeological-operations', 'site'))
- reference = forms.CharField(label=_(u"Reference"), max_length=200,
+ reference = forms.CharField(label=_("Reference"), max_length=200,
required=False)
- name = forms.CharField(label=_(u"Name"), max_length=200, required=False)
+ name = forms.CharField(label=_("Name"), max_length=200, required=False)
other_reference = forms.CharField(label=_("Other reference"),
max_length=200, required=False)
- periods = forms.ChoiceField(label=_(u"Periods"), choices=[], required=False)
- remains = forms.ChoiceField(label=_(u"Remains"), choices=[], required=False)
+ periods = forms.ChoiceField(label=_("Periods"), choices=[], required=False)
+ remains = forms.ChoiceField(label=_("Remains"), choices=[], required=False)
cultural_attributions = forms.ChoiceField(
label=_("Cultural attribution"), choices=[], required=False)
towns = get_town_field()
towns__areas = forms.ChoiceField(label=_("Areas"), choices=[])
- comment = forms.CharField(label=_(u"Comment"), max_length=200,
+ comment = forms.CharField(label=_("Comment"), max_length=200,
required=False)
top_operation = forms.IntegerField(
- label=_(u"Top operation"), required=False,
+ label=_("Top operation"), required=False,
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-operation'),
associated_model=models.Operation),
validators=[valid_id(models.Operation)])
operation = forms.IntegerField(
- label=_(u"Operation"), required=False,
+ label=_("Operation"), required=False,
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-operation'),
associated_model=models.Operation),
validators=[valid_id(models.Operation)])
locality_ngi = forms.CharField(
- label=_(u"National Geographic Institute locality"), max_length=200,
+ label=_("National Geographic Institute locality"), max_length=200,
required=False)
locality_cadastral = forms.CharField(
- label=_(u"Cadastral locality"), max_length=200,
+ label=_("Cadastral locality"), max_length=200,
required=False)
affmar_number = forms.CharField(
- label=_(u"AffMar number"), required=False, max_length=100)
+ label=_("AffMar number"), required=False, max_length=100)
drassm_number = forms.CharField(
- label=_(u"DRASSM number"), required=False, max_length=100)
+ label=_("DRASSM number"), required=False, max_length=100)
shipwreck_name = forms.CharField(
- label=_(u"Shipwreck name"), max_length=200,
+ label=_("Shipwreck name"), max_length=200,
required=False)
oceanographic_service_localisation = forms.CharField(
- label=_(u"Oceanographic service localisation"), max_length=200,
+ label=_("Oceanographic service localisation"), max_length=200,
required=False)
shipwreck_code = forms.CharField(
- label=_(u"Shipwreck code"), max_length=200,
+ label=_("Shipwreck code"), max_length=200,
required=False)
- sinking_date = DateField(label=_(u"Sinking date"), required=False)
+ sinking_date = DateField(label=_("Sinking date"), required=False)
discovery_area = forms.CharField(
- label=_(u"Discovery area"), max_length=200,
+ label=_("Discovery area"), max_length=200,
required=False)
TYPES = [
FieldType('periods', models.Period),
@@ -1491,9 +1491,9 @@ class SiteFormMultiSelection(LockForm, MultiSearchForm):
class SiteForm(CustomForm, ManageOldType):
HEADERS = {}
- form_label = _(u"General")
- form_admin_name = _(u"Archaeological site - 010 - General")
- form_slug = u"archaeological_site-010-general"
+ form_label = _("General")
+ form_admin_name = _("Archaeological site - 010 - General")
+ form_slug = "archaeological_site-010-general"
associated_models = {'period': models.Period, 'remain': models.RemainType,
'spatial_reference_system': SpatialReferenceSystem,
'cultural_attribution': models.CulturalAttributionType,
@@ -1501,8 +1501,8 @@ class SiteForm(CustomForm, ManageOldType):
base_models = ["period", "remain", "collaborator", "cultural_attribution"]
pk = forms.IntegerField(required=False, widget=forms.HiddenInput)
- reference = forms.CharField(label=_(u"Reference"), max_length=200)
- name = forms.CharField(label=_(u"Name"), max_length=200, required=False)
+ reference = forms.CharField(label=_("Reference"), max_length=200)
+ name = forms.CharField(label=_("Name"), max_length=200, required=False)
other_reference = forms.CharField(label=_("Other reference"),
required=False)
period = forms.MultipleChoiceField(
@@ -1517,29 +1517,29 @@ class SiteForm(CustomForm, ManageOldType):
required=False)
collaborator = widgets.Select2MultipleField(
model=Person, label=_("Collaborators"), required=False, remote=True)
- comment = forms.CharField(label=_(u"Comment"), widget=forms.Textarea,
+ comment = forms.CharField(label=_("Comment"), widget=forms.Textarea,
required=False)
locality_ngi = forms.CharField(
- label=_(u"National Geographic Institute locality"),
+ label=_("National Geographic Institute locality"),
widget=forms.Textarea, required=False
)
locality_cadastral = forms.CharField(
- label=_(u"Cadastral locality"),
+ label=_("Cadastral locality"),
widget=forms.Textarea, required=False
)
- HEADERS['x'] = FormHeader(_(u"Coordinates"))
- x = forms.FloatField(label=_(u"X"), required=False)
- estimated_error_x = forms.FloatField(label=_(u"Estimated error for X"),
+ HEADERS['x'] = FormHeader(_("Coordinates"))
+ x = forms.FloatField(label=_("X"), required=False)
+ estimated_error_x = forms.FloatField(label=_("Estimated error for X"),
required=False)
- y = forms.FloatField(label=_(u"Y"), required=False)
- estimated_error_y = forms.FloatField(label=_(u"Estimated error for Y"),
+ y = forms.FloatField(label=_("Y"), required=False)
+ estimated_error_y = forms.FloatField(label=_("Estimated error for Y"),
required=False)
- z = forms.FloatField(label=_(u"Z"), required=False)
- estimated_error_z = forms.FloatField(label=_(u"Estimated error for Z"),
+ z = forms.FloatField(label=_("Z"), required=False)
+ estimated_error_z = forms.FloatField(label=_("Estimated error for Z"),
required=False)
spatial_reference_system = forms.ChoiceField(
- label=_(u"Spatial Reference System"), required=False, choices=[])
+ label=_("Spatial Reference System"), required=False, choices=[])
PROFILE_FILTER = {
'mapping': [
@@ -1571,15 +1571,15 @@ class SiteForm(CustomForm, ManageOldType):
if 'pk' in self.cleaned_data and self.cleaned_data['pk']:
q = q.exclude(pk=self.cleaned_data['pk'])
if q.count():
- raise forms.ValidationError(_(u"This reference already exists."))
+ raise forms.ValidationError(_("This reference already exists."))
return reference
SiteTownFormset = formset_factory(TownForm, can_delete=True,
formset=TownFormSet)
-SiteTownFormset.form_label = _(u"Towns")
-SiteTownFormset.form_admin_name = _(u"Archaeological site - 020 - Towns")
-SiteTownFormset.form_slug = u"archaeological_site-020-towns"
+SiteTownFormset.form_label = _("Towns")
+SiteTownFormset.form_admin_name = _("Archaeological site - 020 - Towns")
+SiteTownFormset.form_slug = "archaeological_site-020-towns"
def check_underwater_module(self):
@@ -1587,24 +1587,24 @@ def check_underwater_module(self):
class SiteUnderwaterForm(CustomForm, ManageOldType):
- form_label = _(u"Underwater")
- form_admin_name = _(u"Archaeological site - 030 - Underwater")
- form_slug = u"archaeological_site-030-underwater"
+ form_label = _("Underwater")
+ form_admin_name = _("Archaeological site - 030 - Underwater")
+ form_slug = "archaeological_site-030-underwater"
affmar_number = forms.CharField(
- label=_(u"AffMar number"), required=False, max_length=100)
+ label=_("AffMar number"), required=False, max_length=100)
drassm_number = forms.CharField(
- label=_(u"DRASSM number"), required=False, max_length=100)
+ label=_("DRASSM number"), required=False, max_length=100)
shipwreck_name = forms.CharField(
- label=_(u"Shipwreck name"), required=False)
+ label=_("Shipwreck name"), required=False)
shipwreck_code = forms.CharField(
- label=_(u"Shipwreck code"), required=False)
+ label=_("Shipwreck code"), required=False)
sinking_date = DateField(
- label=_(u"Sinking date"), required=False)
+ label=_("Sinking date"), required=False)
discovery_area = forms.CharField(
- label=_(u"Discovery area"), widget=forms.Textarea, required=False)
+ label=_("Discovery area"), widget=forms.Textarea, required=False)
oceanographic_service_localisation = forms.CharField(
- label=_(u"Oceanographic service localisation"),
+ label=_("Oceanographic service localisation"),
widget=forms.Textarea, required=False
)
@@ -1618,36 +1618,36 @@ class AdministrativeActOpeSelect(TableSelect):
_model = models.AdministrativeAct
search_vector = forms.CharField(
- label=_(u"Full text search"), widget=widgets.SearchWidget(
+ label=_("Full text search"), widget=widgets.SearchWidget(
'archaeological-operations', 'administrativeact',
'administrativeactop',
))
year = forms.IntegerField(label=_("Year"))
index = forms.IntegerField(label=_("Index"))
if settings.COUNTRY == 'fr':
- ref_sra = forms.CharField(label=u"Autre référence",
+ ref_sra = forms.CharField(label="Autre référence",
max_length=15)
operation__code_patriarche = forms.CharField(
max_length=500,
widget=OAWidget,
label="Code PATRIARCHE")
act_type = forms.ChoiceField(label=_("Act type"), choices=[])
- indexed = forms.NullBooleanField(label=_(u"Indexed?"))
+ indexed = forms.NullBooleanField(label=_("Indexed?"))
operation__towns = get_town_field()
- parcel = forms.CharField(label=_(u"Parcel"))
+ parcel = forms.CharField(label=_("Parcel"))
if settings.ISHTAR_DPTS:
operation__towns__numero_insee__startswith = forms.ChoiceField(
- label=_(u"Department"), choices=[])
- act_object = forms.CharField(label=_(u"Object"),
+ label=_("Department"), choices=[])
+ act_object = forms.CharField(label=_("Object"),
max_length=300)
history_creator = forms.IntegerField(
- label=_(u"Created by"),
+ label=_("Created by"),
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-person', args=['0', 'user']),
associated_model=Person),
validators=[valid_id(Person)])
history_modifier = forms.IntegerField(
- label=_(u"Modified by"),
+ label=_("Modified by"),
widget=widgets.JQueryAutoComplete(
reverse_lazy('autocomplete-person',
args=['0', 'user']),
@@ -1683,7 +1683,7 @@ class AdministrativeActOpeFormSelection(IshtarForm):
cleaned_data = self.cleaned_data
if 'pk' not in cleaned_data or not cleaned_data['pk']:
raise forms.ValidationError(
- _(u"You should select an administrative act."))
+ _("You should select an administrative act."))
return cleaned_data
@@ -1699,12 +1699,12 @@ class AdministrativeActForm(CustomForm, ManageOldType):
reverse_lazy('autocomplete-person'), associated_model=Person,
new=True),
validators=[valid_id(Person)], required=False)
- act_object = forms.CharField(label=_(u"Object"), max_length=300,
+ act_object = forms.CharField(label=_("Object"), max_length=300,
widget=forms.Textarea, required=False)
signature_date = DateField(
- label=_(u"Signature date"), initial=get_now)
+ label=_("Signature date"), initial=get_now)
if settings.COUNTRY == 'fr':
- ref_sra = forms.CharField(label=u"Autre référence", max_length=15,
+ ref_sra = forms.CharField(label="Autre référence", max_length=15,
required=False)
TYPES = [
@@ -1714,7 +1714,7 @@ class AdministrativeActForm(CustomForm, ManageOldType):
class AdministrativeActOpeForm(AdministrativeActForm):
- form_admin_name = _(u"Operation - Administrative act - General")
+ form_admin_name = _("Operation - Administrative act - General")
form_slug = "operation-adminact-general"
@@ -1748,11 +1748,11 @@ class AdministrativeActModifForm(object):
msg = ''
if year and max_val:
msg = _(
- u"This index already exists for year: %(year)d - use a "
- u"value bigger than %(last_val)d") % {
+ "This index already exists for year: %(year)d - use a "
+ "value bigger than %(last_val)d") % {
'year': year, 'last_val': max_val}
else:
- msg = _(u"Bad index")
+ msg = _("Bad index")
raise forms.ValidationError(msg)
return self.cleaned_data
@@ -1765,7 +1765,7 @@ class AdministrativeActOpeModifForm(AdministrativeActModifForm,
class FinalAdministrativeActDeleteForm(FinalForm):
confirm_msg = " "
- confirm_end_msg = _(u"Would you like to delete this administrative act?")
+ confirm_end_msg = _("Would you like to delete this administrative act?")
class DocumentGenerationAdminActForm(IshtarForm):
@@ -1788,18 +1788,18 @@ class DocumentGenerationAdminActForm(IshtarForm):
def clean(self):
if not self.obj:
raise forms.ValidationError(
- _(u"You should select an administrative act."))
+ _("You should select an administrative act."))
cleaned_data = self.cleaned_data
try:
dt = DocumentTemplate.objects.get(
pk=self.cleaned_data['document_template'])
except DocumentTemplate.DoesNotExist:
- raise forms.ValidationError(_(u"This document is not intended for "
- u"this type of act."))
+ raise forms.ValidationError(_("This document is not intended for "
+ "this type of act."))
if self.obj.act_type.pk not in [
act_type.pk for act_type in dt.acttypes.all()]:
- raise forms.ValidationError(_(u"This document is not intended for "
- u"this type of act."))
+ raise forms.ValidationError(_("This document is not intended for "
+ "this type of act."))
return cleaned_data
def save(self, object_pk):
@@ -1818,7 +1818,7 @@ class DocumentGenerationAdminActForm(IshtarForm):
class GenerateDocForm(IshtarForm):
form_label = _("Doc generation")
doc_generation = forms.ChoiceField(
- required=False, choices=[], label=_(u"Generate the associated doc?"))
+ required=False, choices=[], label=_("Generate the associated doc?"))
def __init__(self, *args, **kwargs):
choices = []
@@ -1830,7 +1830,7 @@ class GenerateDocForm(IshtarForm):
class AdministrativeActRegisterSelect(AdministrativeActOpeSelect):
- indexed = forms.NullBooleanField(label=_(u"Indexed?"))
+ indexed = forms.NullBooleanField(label=_("Indexed?"))
def __init__(self, *args, **kwargs):
super(AdministrativeActRegisterSelect, self).__init__(*args, **kwargs)
@@ -1839,7 +1839,7 @@ class AdministrativeActRegisterSelect(AdministrativeActOpeSelect):
class AdministrativeActRegisterFormSelection(IshtarForm):
- form_label = pgettext_lazy('admin act register', u"Register")
+ form_label = pgettext_lazy('admin act register', "Register")
associated_models = {'pk': models.AdministrativeAct}
currents = {'pk': models.AdministrativeAct}
pk = forms.IntegerField(
@@ -1855,7 +1855,7 @@ class AdministrativeActRegisterFormSelection(IshtarForm):
cleaned_data = self.cleaned_data
if 'pk' not in cleaned_data or not cleaned_data['pk']:
raise forms.ValidationError(
- _(u"You should select an administrative act."))
+ _("You should select an administrative act."))
return cleaned_data
@@ -1875,7 +1875,7 @@ class QAOperationFormMulti(QAForm):
'qa_operator',
]
qa_operation_type = forms.ChoiceField(
- label=_(u"Operation type"), required=False
+ label=_("Operation type"), required=False
)
qa_towns = get_town_field(required=False)
qa_operator = forms.IntegerField(
diff --git a/archaeological_operations/ishtar_menu.py b/archaeological_operations/ishtar_menu.py
index 615e1f491..6a5ae1d46 100644
--- a/archaeological_operations/ishtar_menu.py
+++ b/archaeological_operations/ishtar_menu.py
@@ -29,57 +29,57 @@ from archaeological_operations import models
MENU_SECTIONS = [
(30, SectionItem(
- 'operation_management', _(u"Operation"),
+ 'operation_management', _("Operation"),
css='menu-operation',
childs=[
MenuItem(
- 'operation_search', _(u"Search"),
+ 'operation_search', _("Search"),
model=models.Operation,
access_controls=['view_operation',
'view_own_operation']),
MenuItem(
- 'operation_creation', _(u"Creation"),
+ 'operation_creation', _("Creation"),
model=models.Operation,
access_controls=['add_operation',
'add_own_operation']),
MenuItem(
- 'operation_modification', _(u"Modification"),
+ 'operation_modification', _("Modification"),
model=models.Operation,
access_controls=['change_operation',
'change_own_operation']),
MenuItem(
- 'operation_closing', _(u"Closing"),
+ 'operation_closing', _("Closing"),
model=models.Operation,
access_controls=['close_operation']),
MenuItem(
- 'operation_deletion', _(u"Deletion"),
+ 'operation_deletion', _("Deletion"),
model=models.Operation,
access_controls=['change_operation',
'change_own_operation']),
SectionItem(
'admin_act_operations',
- _(u"Administrative act"),
+ _("Administrative act"),
profile_restriction='files',
childs=[
MenuItem(
'operation_administrativeactop_search',
- _(u"Search"),
+ _("Search"),
model=models.AdministrativeAct,
access_controls=[
'change_administrativeact']),
MenuItem(
'operation_administrativeactop',
- _(u"Creation"),
+ _("Creation"),
model=models.AdministrativeAct,
access_controls=['change_administrativeact']),
MenuItem(
'operation_administrativeactop_modification',
- _(u"Modification"),
+ _("Modification"),
model=models.AdministrativeAct,
access_controls=['change_administrativeact']),
MenuItem(
'operation_administrativeactop_deletion',
- _(u"Deletion"),
+ _("Deletion"),
model=models.AdministrativeAct,
access_controls=['change_administrativeact']),
],),
@@ -87,13 +87,13 @@ MENU_SECTIONS = [
),
(
35, SectionItem(
- 'administrativact_management', _(u"Administrative Act"),
+ 'administrativact_management', _("Administrative Act"),
profile_restriction='files',
css='menu-file',
childs=[
MenuItem(
'administrativact_register',
- pgettext_lazy('admin act register', u"Register"),
+ pgettext_lazy('admin act register', "Register"),
model=models.AdministrativeAct,
access_controls=['view_administrativeact',
'view_own_administrativeact']),
@@ -105,22 +105,22 @@ MENU_SECTIONS = [
profile_restriction='archaeological_site',
childs=[
MenuItem(
- 'site_search', _(u"Search"),
+ 'site_search', _("Search"),
model=models.ArchaeologicalSite,
access_controls=['view_archaeologicalsite',
'view_own_archaeologicalsite']),
MenuItem(
- 'site_creation', _(u"Creation"),
+ 'site_creation', _("Creation"),
model=models.ArchaeologicalSite,
access_controls=['add_archaeologicalsite',
'add_own_archaeologicalsite']),
MenuItem(
- 'site_modification', _(u"Modification"),
+ 'site_modification', _("Modification"),
model=models.ArchaeologicalSite,
access_controls=['change_archaeologicalsite',
'change_own_archaeologicalsite']),
MenuItem('site_deletion',
- _(u"Deletion"),
+ _("Deletion"),
model=models.ArchaeologicalSite,
access_controls=['change_archaeologicalsite']),
]),
@@ -129,15 +129,15 @@ MENU_SECTIONS = [
"""
(
102, SectionItem(
- 'dashboard', _(u"Dashboard"),
+ 'dashboard', _("Dashboard"),
css='menu-operation',
childs=[
MenuItem(
- 'dashboard_main', _(u"General informations"),
+ 'dashboard_main', _("General informations"),
model=models.Operation,
access_controls=['change_operation']),
MenuItem(
- 'dashboard_operation', _(u"Operations"),
+ 'dashboard_operation', _("Operations"),
model=models.Operation,
access_controls=['change_operation']),
]),
diff --git a/archaeological_operations/lookups.py b/archaeological_operations/lookups.py
index 2d70029ce..66bcf0831 100644
--- a/archaeological_operations/lookups.py
+++ b/archaeological_operations/lookups.py
@@ -24,7 +24,7 @@ class OperationLookup(LookupChannel):
return self.model.objects.filter(query).order_by('cached_label')[:20]
def format_item_display(self, item):
- return u"<span class='ajax-label'>%s</span>" % item.cached_label
+ return "<span class='ajax-label'>%s</span>" % item.cached_label
@register('archaeological_site')
@@ -75,7 +75,7 @@ class ParcelLookup(LookupChannel):
return escape(force_text(obj.long_label()))
def format_item_display(self, item):
- return u"<span class='ajax-label'>%s</span>" % item.long_label()
+ return "<span class='ajax-label'>%s</span>" % item.long_label()
@register("cultural_attribution_type")
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py
index 0c4f6330b..014d1071b 100644
--- a/archaeological_operations/models.py
+++ b/archaeological_operations/models.py
@@ -212,7 +212,7 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, CompleteIdentifierIte
'towns__cached_label__iexact'
),
'towns__areas': SearchAltName(
- pgettext_lazy("key for text search", u"area"),
+ pgettext_lazy("key for text search", "area"),
'towns__areas__label__iexact'
),
'comment': SearchAltName(
@@ -286,13 +286,13 @@ class ArchaeologicalSite(DocumentItem, BaseHistorizedItem, CompleteIdentifierIte
QA_LOCK = QuickAction(
url="site-qa-lock", icon_class="fa fa-lock",
- text=_(u"Lock/Unlock"), target="many",
+ text=_("Lock/Unlock"), target="many",
rights=['change_archaeologicalsite',
'change_own_archaeologicalsite']
)
QA_EDIT = QuickAction(
url="site-qa-bulk-update", icon_class="fa fa-pencil",
- text=_(u"Bulk update"), target="many",
+ text=_("Bulk update"), target="many",
rights=['change_archaeologicalsite',
'change_own_archaeologicalsite']
)
@@ -863,7 +863,7 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem,
'towns__cached_label__iexact'
),
'towns__areas': SearchAltName(
- pgettext_lazy("key for text search", u"area"),
+ pgettext_lazy("key for text search", "area"),
'towns__areas__label__iexact'
),
'parcel': SearchAltName(
@@ -1000,12 +1000,12 @@ class Operation(ClosedItem, DocumentItem, BaseHistorizedItem,
QA_EDIT = QuickAction(
url="operation-qa-bulk-update", icon_class="fa fa-pencil",
- text=_(u"Bulk update"), target="many",
+ text=_("Bulk update"), target="many",
rights=['change_operation', 'change_own_operation']
)
QA_LOCK = QuickAction(
url="operation-qa-lock", icon_class="fa fa-lock",
- text=_(u"Lock/Unlock"), target="many",
+ text=_("Lock/Unlock"), target="many",
rights=['change_operation', 'change_own_operation']
)
QUICK_ACTIONS = [
diff --git a/archaeological_operations/utils.py b/archaeological_operations/utils.py
index 801cc6ea4..55fb9ef76 100644
--- a/archaeological_operations/utils.py
+++ b/archaeological_operations/utils.py
@@ -337,12 +337,12 @@ def parse_comment_addr_nature(nature, addr, owner):
nature = parse_string(nature)
comments = []
if nature:
- comments += [u"Aménagement :", nature]
+ comments += ["Aménagement :", nature]
if addr:
- comments += [u"Adresse :", addr]
+ comments += ["Adresse :", addr]
if not comments:
return ""
- return u"\n".join(comments)
+ return "\n".join(comments)
# si pas de start date : premier janvier de year
diff --git a/archaeological_operations/views.py b/archaeological_operations/views.py
index 0c3dc28a1..9bf7779f6 100644
--- a/archaeological_operations/views.py
+++ b/archaeological_operations/views.py
@@ -169,7 +169,7 @@ def dashboard_operation(request, *args, **kwargs):
operation_search_wizard = wizards.OperationSearch.as_view(
[('general-operation_search', forms.OperationFormSelection)],
- label=_(u"Operation search"),
+ label=_("Operation search"),
url_name='operation_search',)
@@ -233,7 +233,7 @@ ope_crea_condition_dict = {
operation_creation_wizard = wizards.OperationWizard.as_view(
wizard_steps,
- label=_(u"New operation"),
+ label=_("New operation"),
condition_dict=ope_crea_condition_dict,
url_name='operation_creation',)
@@ -284,7 +284,7 @@ ope_modif_condition_dict = {
operation_modification_wizard = wizards.OperationModificationWizard.as_view(
operation_modif_wizard_steps,
- label=_(u"Operation modification"),
+ label=_("Operation modification"),
condition_dict=ope_modif_condition_dict,
url_name='operation_modification',)
@@ -316,7 +316,7 @@ operation_closing_steps = [
operation_closing_wizard = wizards.OperationClosingWizard.as_view(
operation_closing_steps,
- label=_(u"Operation closing"),
+ label=_("Operation closing"),
url_name='operation_closing',)
@@ -327,7 +327,7 @@ operation_deletion_steps = [
operation_deletion_wizard = wizards.OperationDeletionWizard.as_view(
operation_deletion_steps,
- label=_(u"Operation deletion"),
+ label=_("Operation deletion"),
url_name='operation_deletion',)
@@ -410,7 +410,7 @@ site_deletion_steps = [
site_deletion_wizard = wizards.SiteDeletionWizard.as_view(
site_deletion_steps,
- label=_(u"Site deletion"),
+ label=_("Site deletion"),
url_name='site_deletion',)
@@ -427,7 +427,7 @@ def site_delete(request, pk):
operation_administrativeactop_search_wizard = wizards.SearchWizard.as_view([
('general-operation_administrativeactop_search',
forms.AdministrativeActOpeFormSelection)],
- label=_(u"Administrative act search"),
+ label=_("Administrative act search"),
url_name='operation_administrativeactop_search',)
administrativeactop_steps = [
@@ -440,7 +440,7 @@ administrativeactop_steps = [
operation_administrativeactop_wizard = \
wizards.OperationAdministrativeActWizard.as_view(
administrativeactop_steps,
- label=_(u"Operation: new administrative act"),
+ label=_("Operation: new administrative act"),
url_name='operation_administrativeactop',)
operation_administrativeactop_modification_wizard = \
@@ -472,7 +472,7 @@ operation_administrativeactop_deletion_wizard = \
forms.AdministrativeActOpeFormSelection),
('final-operation_administrativeactop_deletion',
forms.FinalAdministrativeActDeleteForm)],
- label=_(u"Operation: administrative act deletion"),
+ label=_("Operation: administrative act deletion"),
url_name='operation_administrativeactop_deletion',)
@@ -491,7 +491,7 @@ def operation_administrativeactop_delete(request, pk):
administrativact_register_wizard = SearchWizard.as_view([
('general-administrativact_register',
forms.AdministrativeActRegisterFormSelection)],
- label=pgettext_lazy('admin act register', u"Register"),
+ label=pgettext_lazy('admin act register', "Register"),
url_name='administrativact_register',)
diff --git a/archaeological_operations/widgets.py b/archaeological_operations/widgets.py
index 4ea86188f..fa7306208 100644
--- a/archaeological_operations/widgets.py
+++ b/archaeological_operations/widgets.py
@@ -52,18 +52,18 @@ class ParcelWidget(widgets.MultiWidget):
class SelectParcelWidget(widgets.TextInput):
def render(self, *args, **kwargs):
render = super(SelectParcelWidget, self).render(*args, **kwargs)
- html = u"""{}
+ html = """{}
<div class="input-group-append">
<button class='input-group-text btn btn-success' name='formset_add'
value='add'>{}</button>
- </div>""".format(render, _(u"Add"))
+ </div>""".format(render, _("Add"))
return mark_safe(html)
class OAWidget(forms.TextInput):
def render(self, name, value, attrs=None, renderer=None):
if not value:
- value = u""
+ value = ""
final_attrs = flatatt(
self.build_attrs(attrs, {'name': name, 'value': value}))
dct = {'final_attrs': final_attrs,
diff --git a/archaeological_operations/wizards.py b/archaeological_operations/wizards.py
index fc5ce0bf8..c76bbd313 100644
--- a/archaeological_operations/wizards.py
+++ b/archaeological_operations/wizards.py
@@ -207,8 +207,9 @@ class OperationWizard(Wizard):
has_no_af = [form.prefix for form in forms
if form.prefix == 'townsgeneral-operation'] and True
if has_no_af:
- datas = [[_(u"Warning: No Archaeological File is provided. "
- u"If you have forget it return to the first step."), []]]\
+ datas = [[
+ _("Warning: No Archaeological File is provided. "
+ "If you have forget it return to the first step."), []]]\
+ datas
return datas