diff options
Diffstat (limited to 'archaeological_operations/models.py')
-rw-r--r-- | archaeological_operations/models.py | 79 |
1 files changed, 51 insertions, 28 deletions
diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 8d2c4e376..b15dbf580 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -120,6 +120,8 @@ class ArchaeologicalSite(BaseHistorizedItem, OwnPerms, ValueGetter, "reference", "shipwreck_code", "shipwreck_name", + "drassm_number", + "affmar_number", ] M2M_SEARCH_VECTORS = ["periods__label", "remains__label", "towns__name"] PARENT_SEARCH_VECTORS = ['operations'] @@ -193,6 +195,14 @@ class ArchaeologicalSite(BaseHistorizedItem, OwnPerms, ValueGetter, pgettext_lazy("key for text search", u"top-operation"), 'top_operation__cached_label__icontains' ), + 'drassm_number': ( + pgettext_lazy("key for text search", u"numero-drassm"), + 'drassm_number__iexact' + ), + 'affmar_number': ( + pgettext_lazy("key for text search", u"numero-affmar"), + 'affmar_number__iexact' + ), } for v in ALT_NAMES.values(): for language_code, language_lbl in settings.LANGUAGES: @@ -244,6 +254,10 @@ class ArchaeologicalSite(BaseHistorizedItem, OwnPerms, ValueGetter, _(u"Sinking date"), null=True, blank=True) discovery_area = models.TextField( _(u"Discovery area"), null=True, blank=True) + affmar_number = models.CharField(_(u"Numéro AffMar"), max_length=100, + null=True, blank=True) + drassm_number = models.CharField(_(u"Numéro DRASSM"), max_length=100, + null=True, blank=True) # gis point = models.PointField(_(u"Point"), blank=True, null=True) @@ -542,6 +556,7 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, "scientist__cached_label", "scientific_documentation_comment", "seizure_name", + "drassm_code", ] PROPERTY_SEARCH_VECTORS = [ "full_reference", "short_code_patriarche" @@ -706,6 +721,10 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, pgettext_lazy("key for text search", u"finds-deadline-after"), 'finds_deadline__gte' ), + 'drassm_code': ( + pgettext_lazy("key for text search", u"code-drassm"), + 'drassm_code__iexact' + ), } for v in ALT_NAMES.values(): for language_code, language_lbl in settings.LANGUAGES: @@ -784,34 +803,35 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, blank=True, null=True) old_code = models.CharField(_(u"Old code"), max_length=200, null=True, blank=True) - if settings.COUNTRY == 'fr': - code_patriarche = models.TextField(u"Code PATRIARCHE", null=True, - blank=True, unique=True) - TABLE_COLS = ['code_patriarche'] + TABLE_COLS - BASE_SEARCH_VECTORS = ['code_patriarche'] + BASE_SEARCH_VECTORS - # preventive - fnap_financing = models.FloatField(u"Financement FNAP (%)", - blank=True, null=True) - # preventive - fnap_cost = models.IntegerField(u"Financement FNAP (€)", - blank=True, null=True) - # preventive diag - zoning_prescription = models.NullBooleanField( - _(u"Prescription on zoning"), blank=True, null=True) - # preventive diag - large_area_prescription = models.NullBooleanField( - _(u"Prescription on large area"), blank=True, null=True) - geoarchaeological_context_prescription = models.NullBooleanField( - _(u"Prescription on geoarchaeological context"), blank=True, - null=True) # preventive diag - cira_rapporteur = models.ForeignKey( - Person, related_name='cira_rapporteur', null=True, blank=True, - on_delete=models.SET_NULL, verbose_name=u"Rapporteur CIRA") - negative_result = models.NullBooleanField( - u"Résultat considéré comme négatif", blank=True, null=True) - cira_date = models.DateField(u"Date avis CIRA", null=True, blank=True) - eas_number = models.CharField(u"Numéro de l'EA", max_length=20, - null=True, blank=True) + ## fr + code_patriarche = models.TextField(u"Code PATRIARCHE", null=True, + blank=True, unique=True) + TABLE_COLS = ['code_patriarche'] + TABLE_COLS + BASE_SEARCH_VECTORS = ['code_patriarche'] + BASE_SEARCH_VECTORS + # preventive + fnap_financing = models.FloatField(u"Financement FNAP (%)", + blank=True, null=True) + # preventive + fnap_cost = models.IntegerField(u"Financement FNAP (€)", + blank=True, null=True) + # preventive diag + zoning_prescription = models.NullBooleanField( + _(u"Prescription on zoning"), blank=True, null=True) + # preventive diag + large_area_prescription = models.NullBooleanField( + _(u"Prescription on large area"), blank=True, null=True) + geoarchaeological_context_prescription = models.NullBooleanField( + _(u"Prescription on geoarchaeological context"), blank=True, + null=True) # preventive diag + cira_rapporteur = models.ForeignKey( + Person, related_name='cira_rapporteur', null=True, blank=True, + on_delete=models.SET_NULL, verbose_name=u"Rapporteur CIRA") + negative_result = models.NullBooleanField( + u"Résultat considéré comme négatif", blank=True, null=True) + cira_date = models.DateField(u"Date avis CIRA", null=True, blank=True) + eas_number = models.CharField(u"Numéro de l'EA", max_length=20, + null=True, blank=True) + ## end fr operator_reference = models.CharField( _(u"Operator reference"), max_length=20, null=True, blank=True) common_name = models.TextField(_(u"Generic name"), null=True, blank=True) @@ -846,6 +866,9 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, finds_received = models.NullBooleanField( _(u"Finds received"), blank=True, null=True) + # underwater + drassm_code = models.CharField(_(u"Code DRASSM"), max_length=100, + null=True, blank=True) # judiciary seizure_name = models.TextField(_(u"Seizure name"), blank=True, null=True) official_report_number = models.TextField(_(u"Official report number"), |