Fix Citation List view Source Last Changed Column to sort properly (#723)

Fixes #10893
This commit is contained in:
Paul Culley 2018-11-28 02:04:45 -06:00 committed by Sam Manzi
parent df48f37a46
commit 38bfb760a3
2 changed files with 13 additions and 1 deletions

View File

@ -266,6 +266,18 @@ class CitationBaseModel:
self.set_cached_value(source_handle, "SRC_CHAN", value)
return value
def citation_src_sort_change(self, data):
source_handle = data[COLUMN_SOURCE]
cached, value = self.get_cached_value(source_handle, "SRC_CHAN")
if not cached:
try:
source = self.db.get_source_from_handle(source_handle)
value = "%012x" % source.change
except:
value = ''
self.set_cached_value(source_handle, "SRC_CHAN", value)
return value
# Fields access when 'data' is a Source
def source_src_title(self, data):

View File

@ -91,7 +91,7 @@ class CitationListModel(CitationBaseModel, FlatBaseModel):
self.citation_src_abbr,
self.citation_src_pinfo,
self.citation_src_private,
self.citation_src_chan,
self.citation_src_sort_chan,
self.citation_tag_color
]
FlatBaseModel.__init__(self, db, uistate, scol, order, search=search,