code: def get_fields(self):
          
          all_fields = self.get_all_fields()
          if self.dynamic is False:
              return all_fields
  
          if self.id_only():
              return {}
  
          serializer_fields = copy.deepcopy(all_fields)
          request_fields = self.request_fields
          deferred = self._get_deferred_field_names(serializer_fields)
  
          # apply request overrides
          if request_fields:
              for name, include in six.iteritems(request_fields):
                  if name not in serializer_fields:
                      raise exceptions.ParseError(
                          '"%s" is not a valid field name for "%s".' %
                          (name, self.get_name())
                      )
                  if include is not False and name in deferred:
                      deferred.remove(name)
                  elif include is False:
                      deferred.add(name)
  
          for name in deferred:
              serializer_fields.pop(name)
  
          # Set read_only flags based on read_only_fields meta list.
          # Here to cover DynamicFields not covered by DRF.
          ro_fields = getattr(self.Meta, 'read_only_fields', [])
          self.flag_fields(serializer_fields, ro_fields, 'read_only', True)
  
          pw_fields = getattr(self.Meta, 'untrimmed_fields', [])
          self.flag_fields(
              serializer_fields,
              pw_fields,
              'trim_whitespace',
              False,
          )
  
          # Toggle read_only flags for immutable fields.
          # Note: This overrides `read_only` if both are set, to allow
          #       inferred DRF fields to be made immutable.
          immutable_field_names = self._get_flagged_field_names(
              serializer_fields,
              'immutable'
          )
          self.flag_fields(
              serializer_fields,
              immutable_field_names,
              'read_only',
              value=False if self.get_request_method() == 'POST' else True
          )
  
          return serializer_fields
docs: Returns the serializer's field set.
  
          If `dynamic` is True, respects field inclusions/exlcusions.
          Otherwise, reverts back to standard DRF behavior.