diff options
Diffstat (limited to 'archaeological_finds/forms.py')
| -rw-r--r-- | archaeological_finds/forms.py | 7 | 
1 files changed, 7 insertions, 0 deletions
diff --git a/archaeological_finds/forms.py b/archaeological_finds/forms.py index 358b12477..fbcc32013 100644 --- a/archaeological_finds/forms.py +++ b/archaeological_finds/forms.py @@ -453,6 +453,7 @@ class FindSelect(CustomForm, TableSelect):              reverse_lazy('autocomplete-contextrecord'),              associated_model=ContextRecord),          validators=[valid_id(ContextRecord)]) +    basket = forms.ChoiceField(label=_(u"Basket"), choices=[])      ope_relation_types = forms.ChoiceField(          label=_(u"Search within related operations"), choices=[])      cr_relation_types = forms.ChoiceField( @@ -497,6 +498,12 @@ class FindSelect(CustomForm, TableSelect):          if 'cr_relation_types' in self.fields:              self.fields['cr_relation_types'].choices = CRRelationType.get_types(                  ) +        if 'basket' in self.fields: +            self.fields['basket'].choices = [('', '--')] +            if self.current_user: +                self.fields['basket'].choices += [ +                    (b.pk, b.label) for b in models.FindBasket.objects.filter( +                        user=self.current_user).all()]      def get_input_ids(self):          ids = super(FindSelect, self).get_input_ids()  | 
