diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-09 17:50:00 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-13 18:26:04 +0200 | 
| commit | 3ab10cd96173edd3786eb6fd69dbcc4ac0f4772e (patch) | |
| tree | 9fc8f7a188e54dd18f5be1054ea442389ae0ee38 /archaeological_operations/models.py | |
| parent | 1bceebf5c01b7aaf58bba85544679e7e1d2cc257 (diff) | |
| download | Ishtar-3ab10cd96173edd3786eb6fd69dbcc4ac0f4772e.tar.bz2 Ishtar-3ab10cd96173edd3786eb6fd69dbcc4ac0f4772e.zip | |
search vector update: prevent circular referencing
Diffstat (limited to 'archaeological_operations/models.py')
| -rw-r--r-- | archaeological_operations/models.py | 35 | 
1 files changed, 29 insertions, 6 deletions
| diff --git a/archaeological_operations/models.py b/archaeological_operations/models.py index 035235b51..f09184a32 100644 --- a/archaeological_operations/models.py +++ b/archaeological_operations/models.py @@ -101,12 +101,21 @@ class ArchaeologicalSite(BaseHistorizedItem):      SHOW_URL = 'show-site'      TABLE_COLS = ['reference', 'name', 'towns', 'periods', 'remains']      SLUG = 'site' +      BASE_SEARCH_VECTORS = [ -        "reference", "name", "oceanographic_service_localisation", -        "shipwreck_code", "comment", "shipwreck_name", "discovery_area", +        "comment", +        "discovery_area", +        "locality_cadastral", +        "locality_ngi", +        "name", +        "oceanographic_service_localisation", +        "reference", +        "shipwreck_code", +        "shipwreck_name",      ]      M2M_SEARCH_VECTORS = ["periods__label", "remains__label", "towns__name"]      PARENT_SEARCH_VECTORS = ['operations'] +      reference = models.CharField(_(u"Reference"), max_length=200, unique=True)      name = models.CharField(_(u"Name"), max_length=200,                              null=True, blank=True) @@ -354,12 +363,26 @@ class Operation(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter,                                               u"reference)"),      }      BASE_SEARCH_VECTORS = [ -        "scientist__raw_name", "cached_label", "common_name", "comment", -        "address", "old_code", "seizure_name", "official_report_number", -        "name_of_the_protagonist" +        "abstract", +        "address", +        "code_patriarche", +        "comment", +        "common_name", +        "in_charge__cached_label", +        "name_of_the_protagonist", +        "official_report_number", +        "old_code", +        "operation_type__label", +        "operator_reference", +        "operator__cached_label", +        "scientist__cached_label", +        "scientific_documentation_comment", +        "seizure_name",      ]      INT_SEARCH_VECTORS = ["year"] -    M2M_SEARCH_VECTORS = ["towns__name"] +    M2M_SEARCH_VECTORS = ["periods__label", "remains__label", "towns__name"] +    PARENT_SEARCH_VECTORS = ["associated_file"] +    PARENT_ONLY_SEARCH_VECTORS = ["archaeological_sites"]      ASSOCIATED = {          "scientist": {              ('person_types', PersonType): ( | 
