mirror of
https://github.com/netbox-community/netbox.git
synced 2025-08-17 13:08:16 -06:00
Restore get_queryset() on BriefModeMixin, minus prefetch logic
This commit is contained in:
parent
1ebd0a0e0f
commit
96eaaac201
@ -52,6 +52,19 @@ class BriefModeMixin:
|
|||||||
|
|
||||||
return self.serializer_class
|
return self.serializer_class
|
||||||
|
|
||||||
|
def get_queryset(self):
|
||||||
|
qs = super().get_queryset()
|
||||||
|
|
||||||
|
if self.brief:
|
||||||
|
serializer_class = self.get_serializer_class()
|
||||||
|
|
||||||
|
# Clear any annotations for fields not present on the nested serializer
|
||||||
|
for annotation in list(qs.query.annotations.keys()):
|
||||||
|
if annotation not in serializer_class().fields:
|
||||||
|
qs.query.annotations.pop(annotation)
|
||||||
|
|
||||||
|
return qs
|
||||||
|
|
||||||
|
|
||||||
class CustomFieldsMixin:
|
class CustomFieldsMixin:
|
||||||
"""
|
"""
|
||||||
|
Loading…
Reference in New Issue
Block a user