From fab4d28bed4ec75e2efa6527503f3a5ca466534c Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Mon, 20 Aug 2018 18:42:36 +0200 Subject: Fix sorting on tables --- archaeological_files/models.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'archaeological_files/models.py') diff --git a/archaeological_files/models.py b/archaeological_files/models.py index a60e01f64..a4de6e0e4 100644 --- a/archaeological_files/models.py +++ b/archaeological_files/models.py @@ -87,7 +87,7 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, SLUG = 'file' SHOW_URL = 'show-file' TABLE_COLS = ['numeric_reference', 'year', 'internal_reference', - 'file_type', 'saisine_type', 'towns', ] + 'file_type', 'saisine_type', 'towns_label', ] # search parameters BOOL_FIELDS = ['end_date__isnull'] @@ -109,6 +109,7 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, 'general_contractor__attached_to__pk', 'history_creator': 'history_creator__ishtaruser__person__pk', 'history_modifier': 'history_modifier__ishtaruser__person__pk', + 'towns_label': 'towns', } BASE_SEARCH_VECTORS = [ 'name', 'internal_reference', 'file_type__label', 'saisine_type__label', @@ -122,6 +123,10 @@ class File(ClosedItem, BaseHistorizedItem, OwnPerms, ValueGetter, 'scientist' ] + COL_LABELS = { + 'towns_label': _(u"Towns"), + } + # alternative names of fields for searches ALT_NAMES = { 'year': ( -- cgit v1.2.3