1
0
mirror of https://github.com/netbox-community/netbox.git synced 2024-05-10 07:54:54 +00:00

add support for regions and vms

This commit is contained in:
John Anderson
2020-10-23 01:18:04 -04:00
parent 3ba18633de
commit 22d2289ed2
9 changed files with 87 additions and 49 deletions

View File

@ -1,3 +1,4 @@
from django.contrib.postgres.aggregates import JSONBAgg
from django.db.models import F, Func
@ -7,3 +8,12 @@ class CollateAsChar(Func):
"""
function = 'C'
template = '(%(expressions)s) COLLATE "%(function)s"'
class EmptyGroupByJSONBAgg(JSONBAgg):
"""
JSONBAgg is a builtin aggregation function which means it includes the use of a GROUP BY clause.
When used as an annotation for collecting config context data objects, the GROUP BY is
incorrect. This subclass overrides the Django ORM aggregation control to remove the GROUP BY.
"""
contains_aggregate = False