Browse Source

Remove an unused serializer field

pull/1370/head
Hironsan 3 years ago
parent
commit
c859cf3704
1 changed files with 0 additions and 11 deletions
  1. 11
      backend/api/serializers.py

11
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())

Loading…
Cancel
Save