summaryrefslogtreecommitdiff
path: root/archaeological_finds
diff options
context:
space:
mode:
Diffstat (limited to 'archaeological_finds')
-rw-r--r--archaeological_finds/forms.py14
-rw-r--r--archaeological_finds/models_finds.py2
2 files changed, 16 insertions, 0 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py
index 2c367043c..1e45ca4b3 100644
--- a/archaeological_finds/forms.py
+++ b/archaeological_finds/forms.py
@@ -48,6 +48,8 @@ from ishtar_common.utils import convert_coordinates_to_point
from ishtar_common import widgets
from archaeological_operations.widgets import OAWidget
+from archaeological_warehouse.models import Warehouse
+
from archaeological_finds.forms_treatments import TreatmentSelect, \
TreatmentFormSelection, BaseTreatmentForm, TreatmentModifyForm, \
AdministrativeActTreatmentForm, TreatmentFormFileChoice, \
@@ -349,6 +351,18 @@ class FindSelect(TableSelect):
widget=widgets.CheckboxSelectMultiple)
datings__period = forms.ChoiceField(label=_(u"Period"), choices=[])
# TODO search by warehouse
+ container__location = forms.IntegerField(
+ label=_(u"Warehouse (location)"),
+ widget=widgets.JQueryAutoComplete(
+ reverse_lazy('autocomplete-warehouse'),
+ associated_model=Warehouse),
+ validators=[valid_id(Warehouse)])
+ container__responsible = forms.IntegerField(
+ label=_(u"Warehouse (responsible)"),
+ widget=widgets.JQueryAutoComplete(
+ reverse_lazy('autocomplete-warehouse'),
+ associated_model=Warehouse),
+ validators=[valid_id(Warehouse)])
material_types = forms.ChoiceField(label=_(u"Material type"), choices=[])
object_types = forms.ChoiceField(label=_(u"Object type"), choices=[])
preservation_to_considers = forms.ChoiceField(
diff --git a/archaeological_finds/models_finds.py b/archaeological_finds/models_finds.py
index 4ece0b286..1d4d6e369 100644
--- a/archaeological_finds/models_finds.py
+++ b/archaeological_finds/models_finds.py
@@ -571,6 +571,8 @@ class Find(BaseHistorizedItem, ImageModel, OwnPerms, ShortMenuItem):
'basket': 'basket',
'cached_label': 'cached_label__icontains',
'image__isnull': 'image__isnull',
+ 'container__location': 'container__location__pk',
+ 'container__responsible': 'container__responsible__pk',
}
EXTRA_REQUEST_KEYS.update(
dict(