forked from github/plane
fix: n+1s (#1514)
* dev: fix workspace n+1 * dev: trim down label details for issue state serializer
This commit is contained in:
parent
f9f8b5c3d9
commit
e0181342c0
@ -462,9 +462,9 @@ class IssueAttachmentSerializer(BaseSerializer):
|
|||||||
|
|
||||||
# Issue Serializer with state details
|
# Issue Serializer with state details
|
||||||
class IssueStateSerializer(BaseSerializer):
|
class IssueStateSerializer(BaseSerializer):
|
||||||
|
label_details = LabelLiteSerializer(read_only=True, source="labels", many=True)
|
||||||
state_detail = StateLiteSerializer(read_only=True, source="state")
|
state_detail = StateLiteSerializer(read_only=True, source="state")
|
||||||
project_detail = ProjectLiteSerializer(read_only=True, source="project")
|
project_detail = ProjectLiteSerializer(read_only=True, source="project")
|
||||||
label_details = LabelSerializer(read_only=True, source="labels", many=True)
|
|
||||||
assignee_details = UserLiteSerializer(read_only=True, source="assignees", many=True)
|
assignee_details = UserLiteSerializer(read_only=True, source="assignees", many=True)
|
||||||
sub_issues_count = serializers.IntegerField(read_only=True)
|
sub_issues_count = serializers.IntegerField(read_only=True)
|
||||||
bridge_id = serializers.UUIDField(read_only=True)
|
bridge_id = serializers.UUIDField(read_only=True)
|
||||||
|
@ -101,6 +101,7 @@ class WorkSpaceViewSet(BaseViewSet):
|
|||||||
.filter(workspace_member__member=self.request.user)
|
.filter(workspace_member__member=self.request.user)
|
||||||
.annotate(total_members=member_count)
|
.annotate(total_members=member_count)
|
||||||
.annotate(total_issues=issue_count)
|
.annotate(total_issues=issue_count)
|
||||||
|
.select_related("owner")
|
||||||
)
|
)
|
||||||
|
|
||||||
def create(self, request):
|
def create(self, request):
|
||||||
|
Loading…
Reference in New Issue
Block a user