title: DRF SerializerMethodField how to pass parameters
body: <p>Is there a way to pass paremeters to a Django Rest Framework's SerializerMethodField?</p>
  
  <p>Assume I have the models:</p>
  
  <pre class="lang-py prettyprint-override"><code>class Owner(models.Model):
      name = models.CharField(max_length=10)
  
  class Item(models.Model):
      name = models.CharField(max_length=10)
      owner = models.ForeignKey('Owner', related_name='items')
      itemType = models.CharField(max_length=5) # either "type1" or "type2"
  </code></pre>
  
  <p>What I need is to return an Owner JSON object with the fields: name, type1items, type2items.</p>
  
  <p>My current solution is this:</p>
  
  <pre class="lang-py prettyprint-override"><code>class ItemSerializer(serializers.ModelSerializer):
      class Meta:
          model = models.Item
          fields = ('name', 'itemType')
  
  class OwnerSerializer(serializers.ModelSerializer):
      type1items = serializers.SerializerMethodField(method_name='getType1Items')
      type2items = serializers.SerializerMethodField(method_name='getType2Items')
  
      class Meta:
          model = models.Owner
          fields = ('name', 'type1items', 'type2items')
  
      def getType1Items(self, ownerObj):
          queryset = models.Item.objects.filter(owner__id=ownerObj.id).filter(itemType="type1")
          return ItemSerializer(queryset, many=True).data
  
      def getType2Items(self, ownerObj):
          queryset = models.Item.objects.filter(owner__id=ownerObj.id).filter(itemType="type2")
          return ItemSerializer(queryset, many=True).data
  </code></pre>
  
  <p>This works. But it would be much cleaner if I could pass a parameter to the method instead of using two methods with almost the exact code. Ideally it would look like this:</p>
  
  <pre class="lang-py prettyprint-override"><code>...
  class OwnerSerializer(serializers.ModelSerializer):
      type1items = serializers.SerializerMethodField(method_name='getItems', "type1")
      type2items = serializers.SerializerMethodField(method_name='getItems', "type2")
  
      class Meta:
          model = models.Owner
          fields = ('name', 'type1items', 'type2items')
  
      def getItems(self, ownerObj, itemType):
          queryset = models.Item.objects.filter(owner__id=ownerObj.id).filter(itemType=itemType)
          return ItemSerializer(queryset, many=True).data
  </code></pre>
  
  <p>In the docs <a href="https://www.django-rest-framework.org/api-guide/fields/#serializermethodfield" rel="nofollow noreferrer">SerializerMethodField accepts only one parameter</a> which is <code>method_name</code>.</p>
  
  <p>Is there any way to achieve this behaviour using SerializerMethodField? (The example code here is overly simplified so there might be mistakes.)</p>