From c859cf370422a30c985463f95723735d26aa0d84 Mon Sep 17 00:00:00 2001 From: Hironsan Date: Sat, 15 May 2021 09:20:06 +0900 Subject: [PATCH] Remove an unused serializer field --- backend/api/serializers.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/backend/api/serializers.py b/backend/api/serializers.py index 1be0b142..5316beb2 100644 --- a/backend/api/serializers.py +++ b/backend/api/serializers.py @@ -201,17 +201,6 @@ class ProjectPolymorphicSerializer(PolymorphicSerializer): } -class ProjectFilteredPrimaryKeyRelatedField(serializers.PrimaryKeyRelatedField): - - def get_queryset(self): - view = self.context.get('view', None) - request = self.context.get('request', None) - queryset = super(ProjectFilteredPrimaryKeyRelatedField, self).get_queryset() - if not request or not queryset or not view: - return None - return queryset.filter(project=view.kwargs['project_id']) - - class CategorySerializer(serializers.ModelSerializer): label = serializers.PrimaryKeyRelatedField(queryset=Label.objects.all()) example = serializers.PrimaryKeyRelatedField(queryset=Example.objects.all())