class SomeSerializer(serializers.Serializer):
def __init__(self):
super().__init__()
request = self.context["request"]
if request.method == "GET":
self.fields += serializers.IntegerField(read_only=True)
else:
....