title: Pass extra arguments to Serializer Class in Django Rest Framework
body: <p>I want to pass some arguments to DRF Serializer class from Viewset, so for I have tried this:</p>
  
  <pre><code>class OneZeroSerializer(rest_serializer.ModelSerializer):
  
      def __init__(self, *args, **kwargs):
          print args # show values that passed
  
      location = rest_serializer.SerializerMethodField('get_alternate_name')
  
      def get_alternate_name(self, obj):
          return ''
  
  
      class Meta:
          model = OneZero
  
          fields = ('id', 'location')
  </code></pre>
  
  <p><strong>Views</strong></p>
  
  <pre><code>class OneZeroViewSet(viewsets.ModelViewSet):
  
     serializer_class = OneZeroSerializer(realpart=1)
     #serializer_class = OneZeroSerializer
  
     queryset = OneZero.objects.all()
  </code></pre>
  
  <p>Basically I want to pass some value based on querystring from views to Serializer class and then these will be allocate to fields.</p>
  
  <p>These fields are not include in Model in fact dynamically created fields.</p>
  
  <p>Same case in this question <a href="https://stackoverflow.com/questions/18696403/dynamically-modifying-serializer-fields-in-django-rest-framework">stackoverflow</a>, but I cannot understand the answer.</p>
  
  <p>Can anyone help me in this case or suggest me better options.</p>