diff options
| -rw-r--r-- | archaeological_files/forms.py | 7 | ||||
| -rw-r--r-- | archaeological_files/ishtar_menu.py | 2 | ||||
| -rw-r--r-- | archaeological_files/views.py | 20 | ||||
| -rw-r--r-- | archaeological_operations/ishtar_menu.py | 2 | 
4 files changed, 18 insertions, 13 deletions
| diff --git a/archaeological_files/forms.py b/archaeological_files/forms.py index 50d67027c..4ff483a75 100644 --- a/archaeological_files/forms.py +++ b/archaeological_files/forms.py @@ -48,6 +48,9 @@ from ishtar_common import widgets  GENERAL_CONTRACTOR, created = PersonType.objects.get_or_create(                                      txt_idx='general_contractor') +GENERAL_CONTRACTOR_ORGA, created = OrganizationType.objects.get_or_create( +                                    txt_idx='general_contractor') +  class FileSelect(TableSelect):      year = forms.IntegerField(label=_("Year"))      numeric_reference = forms.IntegerField(label=_("Numeric reference")) @@ -70,7 +73,7 @@ class FileSelect(TableSelect):                  label=_(u"Organization of general contractor"),              widget=widgets.JQueryAutoComplete(                  reverse_lazy('autocomplete-organization', -                args=[GENERAL_CONTRACTOR.pk]), +                args=[GENERAL_CONTRACTOR_ORGA.pk]),                  associated_model=Organization),              validators=[valid_id(Organization)])      in_charge = forms.IntegerField( @@ -316,7 +319,7 @@ class AdministrativeActFileSelect(TableSelect):                  label=_(u"Organization of general contractor"),              widget=widgets.JQueryAutoComplete(                  reverse_lazy('autocomplete-organization', -                args=[GENERAL_CONTRACTOR.pk]), +                args=[GENERAL_CONTRACTOR_ORGA.pk]),                  associated_model=Organization),              validators=[valid_id(Organization)])      associated_file__numeric_reference = forms.IntegerField( diff --git a/archaeological_files/ishtar_menu.py b/archaeological_files/ishtar_menu.py index be6c0ff5f..fc0401115 100644 --- a/archaeological_files/ishtar_menu.py +++ b/archaeological_files/ishtar_menu.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2010-2013 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2010-2014 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as diff --git a/archaeological_files/views.py b/archaeological_files/views.py index a7c193843..8498352cf 100644 --- a/archaeological_files/views.py +++ b/archaeological_files/views.py @@ -67,16 +67,16 @@ def autocomplete_file(request):  get_file = get_item(models.File, 'get_file', 'file',      bool_fields = ['end_date__isnull'], -    associated_models = [(Person, 'associated_file__general_contractor')],      extra_request_keys={ -            'parcel_0':('parcels__section', -                        'operations__parcels__section'), -            'parcel_1':('parcels__parcel_number', -                        'operations__parcels__parcel_number'), -            'end_date':'end_date__isnull', -            'name':'name__icontains', -            'permit_reference':'permit_reference__icontains', -            'history_creator':'history_creator__ishtaruser__person__pk', +        'parcel_0':('parcels__section', +                    'operations__parcels__section'), +        'parcel_1':('parcels__parcel_number', +                    'operations__parcels__parcel_number'), +        'end_date':'end_date__isnull', +        'name':'name__icontains', +        'permit_reference':'permit_reference__icontains', +        'general_contractor__attached_to':'general_contractor__attached_to__pk', +        'history_creator':'history_creator__ishtaruser__person__pk',              },)  show_file = show_item(models.File, 'file')  revert_file = revert_item(models.File) @@ -94,6 +94,8 @@ get_administrativeactfile = get_item(AdministrativeAct,                'act_type__intented_to':'act_type__intented_to',                'signature_date_before':'signature_date__lte',                'signature_date_after':'signature_date__gte', +              'associated_file__general_contractor__attached_to':\ +                'associated_file__general_contractor__attached_to__pk',                'associated_file__name':'associated_file__name__icontains',                'associated_file__permit_reference':\                            'associated_file__permit_reference__icontains'}, diff --git a/archaeological_operations/ishtar_menu.py b/archaeological_operations/ishtar_menu.py index 830a0ed09..7549bf72b 100644 --- a/archaeological_operations/ishtar_menu.py +++ b/archaeological_operations/ishtar_menu.py @@ -1,6 +1,6 @@  #!/usr/bin/env python  # -*- coding: utf-8 -*- -# Copyright (C) 2012-2013 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet> +# Copyright (C) 2012-2014 Étienne Loks  <etienne.loks_AT_peacefrogsDOTnet>  # This program is free software: you can redistribute it and/or modify  # it under the terms of the GNU Affero General Public License as | 
