@staticmethod<EOL><INDENT>def _prune_fields(field_dict, only):<DEDENT>
fields = [(isinstance(f, str) and f or f.name) for f in only]<EOL>for f in list(field_dict.keys()):<EOL><INDENT>if f not in fields:<EOL><INDENT>field_dict.pop(f)<EOL><DEDENT><DEDENT>return field_dict<EOL>
Filter fields data **in place** with `only` list.

        Example::

            self._prune_fields(field_dict, ['slug', 'text'])
            self._prune_fields(field_dict, [MyModel.slug])