              return [field.name for field in opts.fields + opts.many_to_many]
          else:
              return obj.keys()
  
      def get_related_serializer(self, key):
          info = _fields_to_dict(self.fields).get(key, None)
  
          # If an element in `fields` is a 2-tuple of (str, tuple)
          # then the second element of the tuple is the fields to
          # set on the related serializer
          if isinstance(info, (list, tuple)):
              class OnTheFlySerializer(self.__class__):
 
</s> remove         """
        Return the set of field names/keys to use for a model instance/dict.
        """
 </s> add  </s> remove         for fname in fields:
 </s> add         for fname, related_info in _fields_to_list(fields): </s> remove     return [_field_to_tuple(field)[0] for field in fields or ()]


def _fields_to_dict(fields):
    """
    Return a `dict` of field name -> None, or tuple of fields, or Serializer class
    """
    return dict([_field_to_tuple(field) for field in fields or ()])
 </s> add     return [_field_to_tuple(field) for field in fields or ()] </s> remove         else:
            fields = _fields_to_list(self.fields)

 </s> add  </s> remove     Return a list of field names.
 </s> add     Return a list of field tuples.
    def get_related_serializer(self, info):
              return [field.name for field in opts.fields + opts.many_to_many]
          else:
              return obj.keys()
  
    def get_related_serializer(self, info):
    def get_related_serializer(self, info):
    def get_related_serializer(self, info):
          # If an element in `fields` is a 2-tuple of (str, tuple)
          # then the second element of the tuple is the fields to
          # set on the related serializer
          if isinstance(info, (list, tuple)):
              class OnTheFlySerializer(self.__class__):
keep keep keep keep replace replace replace keep keep keep keep keep
 Fix for #178.

Related serializers passed in via include now work as expected. 
djangorestframework/serializer.py