Commit 6fde18eb by Őry Máté

dashboard: prefetch vm subactivities for performance

parent 8b39c899
...@@ -197,10 +197,11 @@ class VmDetailView(CheckedDetailView): ...@@ -197,10 +197,11 @@ class VmDetailView(CheckedDetailView):
}) })
# activity data # activity data
ia = InstanceActivity.objects.filter( context['activities'] = (
instance=self.object, parent=None InstanceActivity.objects.filter(
).order_by('-started').select_related() instance=self.object, parent=None).
context['activities'] = ia order_by('-started').
select_related('user').prefetch_related('children'))
context['vlans'] = Vlan.get_objects_with_level( context['vlans'] = Vlan.get_objects_with_level(
'user', self.request.user 'user', self.request.user
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment