mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-26 17:26:10 -06:00
12252 allow sorting on object in search
This commit is contained in:
parent
f867cb3ae0
commit
bc9feb4a57
@ -145,9 +145,13 @@ class CachedValueSearchBackend(SearchBackend):
|
|||||||
)
|
)
|
||||||
|
|
||||||
# Omit any results pertaining to an object the user does not have permission to view
|
# 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
|
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):
|
def cache(self, instances, indexer=None, remove_existing=True):
|
||||||
content_type = None
|
content_type = None
|
||||||
|
@ -204,7 +204,8 @@ class SearchTable(tables.Table):
|
|||||||
order_by="object___meta__verbose_name",
|
order_by="object___meta__verbose_name",
|
||||||
)
|
)
|
||||||
object = tables.Column(
|
object = tables.Column(
|
||||||
linkify=True
|
linkify=True,
|
||||||
|
order_by=('name', )
|
||||||
)
|
)
|
||||||
field = tables.Column()
|
field = tables.Column()
|
||||||
value = tables.Column()
|
value = tables.Column()
|
||||||
|
Loading…
Reference in New Issue
Block a user