Просмотр исходного кода

Closes #9261: NetBoxTable no longer automatically clears pre-existing calls to prefetch_related() on its queryset

jeremystretch 3 лет назад
Родитель
Сommit
61d756c7c4
2 измененных файлов с 5 добавлено и 1 удалено
  1. 4 0
      docs/release-notes/version-3.3.md
  2. 1 1
      netbox/netbox/tables/tables.py

+ 4 - 0
docs/release-notes/version-3.3.md

@@ -7,6 +7,10 @@
 * [#8495](https://github.com/netbox-community/netbox/issues/8495) - Enable custom field grouping
 * [#8995](https://github.com/netbox-community/netbox/issues/8995) - Enable arbitrary ordering of REST API results
 
+### Other Changes
+
+* [#9261](https://github.com/netbox-community/netbox/issues/9261) - `NetBoxTable` no longer automatically clears pre-existing calls to `prefetch_related()` on its queryset
+
 ### REST API Changes
 
 * extras.CustomField

+ 1 - 1
netbox/netbox/tables/tables.py

@@ -97,7 +97,7 @@ class BaseTable(tables.Table):
                             break
                     if prefetch_path:
                         prefetch_fields.append('__'.join(prefetch_path))
-            self.data.data = self.data.data.prefetch_related(None).prefetch_related(*prefetch_fields)
+            self.data.data = self.data.data.prefetch_related(*prefetch_fields)
 
     def _get_columns(self, visible=True):
         columns = []