diff options
-rw-r--r-- | archaeological_finds/forms.py | 6 | ||||
-rw-r--r-- | archaeological_finds/models_finds.py | 11 | ||||
-rw-r--r-- | archaeological_warehouse/forms.py | 12 | ||||
-rw-r--r-- | archaeological_warehouse/models.py | 21 |
4 files changed, 47 insertions, 3 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 738b634e9..d5ce0e025 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -920,12 +920,18 @@ class FindSelect(HistorySelect): reverse_lazy('autocomplete-archaeologicalsite'), associated_model=ArchaeologicalSite), validators=[valid_id(ArchaeologicalSite)]) + archaeological_sites_name = forms.CharField( + label=_(u"Archaeological site name (attached to the operation)") + ) archaeological_sites_context_record = forms.IntegerField( label=_("Archaeological site (attached to the context record)"), widget=widgets.JQueryAutoComplete( reverse_lazy('autocomplete-archaeologicalsite'), associated_model=ArchaeologicalSite), validators=[valid_id(ArchaeologicalSite)]) + archaeological_sites_context_record_name = forms.CharField( + label=_(u"Archaeological site name (attached to the context record)") + ) base_finds__context_record = forms.IntegerField( label=_("Context record"), widget=widgets.JQueryAutoComplete( diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py index 6f8199412..541fe2df1 100644 --- a/archaeological_finds/models_finds.py +++ b/archaeological_finds/models_finds.py @@ -867,11 +867,22 @@ class Find(BulkUpdatedItem, ValueGetter, BaseHistorizedItem, OwnPerms, pgettext_lazy("key for text search", u"site"), 'base_finds__context_record__operation__archaeological_sites__' 'cached_label__icontains'), + 'archaeological_sites_name': + SearchAltName( + pgettext_lazy("key for text search", u"site-name"), + 'base_finds__context_record__operation__archaeological_sites__' + 'name__iexact'), 'archaeological_sites_context_record': SearchAltName( pgettext_lazy("key for text search", u"context-record-site"), 'base_finds__context_record__archaeological_site__' 'cached_label__icontains'), + 'archaeological_sites_context_record_name': + SearchAltName( + pgettext_lazy("key for text search", + u"context-record-site-name"), + 'base_finds__context_record__archaeological_site__' + 'name__iexact'), 'base_finds__context_record': SearchAltName( pgettext_lazy("key for text search", u"context-record"), diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index b6bff3d5b..7a84b2833 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -268,21 +268,29 @@ class ContainerSelect(HistorySelect): responsible_name = get_warehouse_field(label=_(u"Responsible warehouse")) container_type = forms.ChoiceField(label=_(u"Container type"), choices=[]) reference = forms.CharField(label=_(u"Ref.")) + old_reference = forms.CharField(label=_(u"Old reference")) + comment = forms.CharField(label=_(u"Comment")) - code_patriarche = forms.IntegerField(label=_(u"Code PATRIARCHE"), - widget=OAWidget) archaeological_sites = forms.IntegerField( label=_("Archaeological site (attached to the operation)"), widget=widgets.JQueryAutoComplete( reverse_lazy('autocomplete-archaeologicalsite'), associated_model=ArchaeologicalSite), validators=[valid_id(ArchaeologicalSite)]) + archaeological_sites_name = forms.CharField( + label=_(u"Archaeological site name (attached to the operation)") + ) archaeological_sites_context_record = forms.IntegerField( label=_("Archaeological site (attached to the context record)"), widget=widgets.JQueryAutoComplete( reverse_lazy('autocomplete-archaeologicalsite'), associated_model=ArchaeologicalSite), validators=[valid_id(ArchaeologicalSite)]) + archaeological_sites_context_record_name = forms.CharField( + label=_(u"Archaeological site name (attached to the context record)") + ) + code_patriarche = forms.IntegerField(label=_(u"Code PATRIARCHE"), + widget=OAWidget) context_record = forms.IntegerField( label=_("Context record"), widget=widgets.JQueryAutoComplete( diff --git a/archaeological_warehouse/models.py b/archaeological_warehouse/models.py index dc39434c6..d36d1a83c 100644 --- a/archaeological_warehouse/models.py +++ b/archaeological_warehouse/models.py @@ -323,7 +323,7 @@ class Container(LightHistorizedItem, OwnPerms): 'cached_division', 'old_reference'] IMAGE_PREFIX = 'containers/' BASE_SEARCH_VECTORS = ['reference', 'container_type__label', - 'cached_location'] + 'cached_location', 'old_reference', 'comment'] M2M_SEARCH_VECTORS = ['division__reference', 'division__division__division__label'] @@ -367,6 +367,14 @@ class Container(LightHistorizedItem, OwnPerms): pgettext_lazy("key for text search", u"reference"), 'reference__iexact' ), + 'old_reference': SearchAltName( + pgettext_lazy("key for text search", u"old-reference"), + 'old_reference__iexact' + ), + 'comment': SearchAltName( + pgettext_lazy("key for text search", u"comment"), + 'comment__iexact' + ), 'code_patriarche': SearchAltName( pgettext_lazy("key for text search", u"code-patriarche"), @@ -378,11 +386,22 @@ class Container(LightHistorizedItem, OwnPerms): pgettext_lazy("key for text search", u"site"), 'finds__base_finds__context_record__operation__' 'archaeological_sites__cached_label__icontains'), + 'archaeological_sites_name': + SearchAltName( + pgettext_lazy("key for text search", u"site-name"), + 'finds__base_finds__context_record__operation__' + 'archaeological_sites__name__iexact'), 'archaeological_sites_context_record': SearchAltName( pgettext_lazy("key for text search", u"context-record-site"), 'finds__base_finds__context_record__archaeological_site__' 'cached_label__icontains'), + 'archaeological_sites_context_record_name': + SearchAltName( + pgettext_lazy("key for text search", + u"context-record-site-name"), + 'finds__base_finds__context_record__archaeological_site__' + 'name__iexact'), 'context_record': SearchAltName( pgettext_lazy("key for text search", u"context-record"), |