diff options
author | Étienne Loks <etienne.loks@proxience.com> | 2015-11-03 00:39:23 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@proxience.com> | 2015-11-03 00:39:23 +0100 |
commit | df3a0564362e1e4c43424af0d3034aeb0000c418 (patch) | |
tree | f6005f71f8d14dfcedc8c4a67eeacf3ce8aca0b1 /archaeological_files_pdl | |
parent | 9a14870b96ced509d9fc5f3625e8ade08c0f04b9 (diff) | |
download | Ishtar-df3a0564362e1e4c43424af0d3034aeb0000c418.tar.bz2 Ishtar-df3a0564362e1e4c43424af0d3034aeb0000c418.zip |
Archaeologicla files: display and allow modifications of town planning service address
Diffstat (limited to 'archaeological_files_pdl')
-rw-r--r-- | archaeological_files_pdl/forms.py | 6 | ||||
-rw-r--r-- | archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js | 1 |
2 files changed, 5 insertions, 2 deletions
diff --git a/archaeological_files_pdl/forms.py b/archaeological_files_pdl/forms.py index 659d22d68..d17797a0b 100644 --- a/archaeological_files_pdl/forms.py +++ b/archaeological_files_pdl/forms.py @@ -253,13 +253,15 @@ class FileFormPlanningService(forms.Form): planning_service = forms.IntegerField( label=_("Planning service"), required=False, - widget=widgets.JQueryAutoComplete( + widget=widgets.JQueryPersonOrganization( reverse_lazy('autocomplete-organization', args=[RESPONSIBLE_PLANNING_SERVICE_ORGA.pk]), + reverse_lazy('organization_create'), + model=models.Organization, limit={ 'organization_type': [RESPONSIBLE_PLANNING_SERVICE_ORGA.pk] }, - associated_model=models.Organization, + js_template='ishtar/blocks/JQueryCorporationPerson.js', new=True), validators=[valid_id(models.Organization)] ) diff --git a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js index be1faabfe..4a3943d3c 100644 --- a/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js +++ b/archaeological_files_pdl/templates/ishtar/blocks/JQueryPersonOrga.js @@ -39,6 +39,7 @@ $(function() { if(ui.item){ url = {{edit_source}}+ui.item.id; $('#id_{{field_id}}').val(ui.item.id); + $('#id_{{field_id}}').change(); } else { $('#id_{{field_id}}').val(null); } |