12252 allow sorting on object in search

This commit is contained in:
Arthur 2023-04-26 15:26:32 -07:00
parent f867cb3ae0
commit bc9feb4a57
2 changed files with 7 additions and 2 deletions

View File

@ -145,9 +145,13 @@ class CachedValueSearchBackend(SearchBackend):
)
# Omit any results pertaining to an object the user does not have permission to view
return [
ret = [
r for r in results if r.object is not None
]
for r in ret:
r.name = str(r.object)
return ret
def cache(self, instances, indexer=None, remove_existing=True):
content_type = None

View File

@ -204,7 +204,8 @@ class SearchTable(tables.Table):
order_by="object___meta__verbose_name",
)
object = tables.Column(
linkify=True
linkify=True,
order_by=('name', )
)
field = tables.Column()
value = tables.Column()