[Update] 优化协议

This commit is contained in:
ibuler
2019-07-05 18:07:10 +08:00
parent 64e1e6191b
commit 3c825440f0
12 changed files with 202 additions and 231 deletions

View File

@@ -130,7 +130,7 @@ class NodeChildrenAsTreeApi(generics.ListAPIView):
include_assets = self.request.query_params.get('assets', '0') == '1'
if not include_assets:
return queryset
assets = self.node.get_assets().prefetch_related("protocols").only(
assets = self.node.get_assets().only(
"id", "hostname", "ip", 'platform', "os", "org_id",
)
for asset in assets: