mirror of
https://github.com/netbox-community/netbox.git
synced 2024-05-10 07:54:54 +00:00
Fixes #4336: Ensure interfaces without a subinterface ID are ordered before subinterface zero
This commit is contained in:
9
netbox/utilities/query_functions.py
Normal file
9
netbox/utilities/query_functions.py
Normal file
@ -0,0 +1,9 @@
|
||||
from django.db.models import F, Func
|
||||
|
||||
|
||||
class CollateAsChar(Func):
|
||||
"""
|
||||
Disregard localization by collating a field as a plain character string. Helpful for ensuring predictable ordering.
|
||||
"""
|
||||
function = 'C'
|
||||
template = '(%(expressions)s) COLLATE "%(function)s"'
|
Reference in New Issue
Block a user