diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-02-12 13:52:38 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2020-02-12 13:52:38 +0100 |
commit | f24d1ad630243434f25b5bbcd5000299fb5b5bc1 (patch) | |
tree | 94b9295db41a1c8c5ca7fd37a94a94c6b5591f54 /archaeological_files | |
parent | 03c123c20af4e0f535ee9bb2fbce5d950d2b7091 (diff) | |
download | Ishtar-f24d1ad630243434f25b5bbcd5000299fb5b5bc1.tar.bz2 Ishtar-f24d1ad630243434f25b5bbcd5000299fb5b5bc1.zip |
Admin: fix and improve performances
Diffstat (limited to 'archaeological_files')
-rw-r--r-- | archaeological_files/admin.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/archaeological_files/admin.py b/archaeological_files/admin.py index 58c1791c0..b5709bd65 100644 --- a/archaeological_files/admin.py +++ b/archaeological_files/admin.py @@ -35,22 +35,26 @@ class FileAdmin(HistorizedObjectAdmin): if settings.COUNTRY == 'fr': list_filter += ['saisine_type'] search_fields = ('name', 'towns__name', 'permit_reference') + ajax_form_dict = HistorizedObjectAdmin.AJAX_FORM_DICT.copy() + ajax_form_dict.update({ + 'in_charge': 'person', + 'general_contractor': 'person', + 'corporation_general_contractor': 'organization', + 'responsible_town_planning_service': 'person', + 'planning_service': 'organization', + 'organization': 'organization', + 'scientist': 'person', + 'main_town': 'town', + 'towns': 'town', + 'related_file': 'file' + }) form = make_ajax_form( - models.File, {'in_charge': 'person', - 'general_contractor': 'person', - 'corporation_general_contractor': 'organization', - 'responsible_town_planning_service': 'person', - 'planning_service': 'organization', - 'organization': 'organization', - 'scientist': 'person', - 'main_town': 'town', - 'towns': 'town', - 'related_file': 'file' - }) + models.File, ajax_form_dict) readonly_fields = HistorizedObjectAdmin.readonly_fields + [ 'raw_general_contractor', 'raw_town_planning_service', 'cached_label', 'imported_line' ] + exclude = ["documents", "main_image"] model = models.File |