code: def _link_fields(self):
          
          query_params = self.get_request_attribute('query_params', {})
          if 'exclude_links' in query_params:
              return {}
          else:
              all_fields = self.get_all_fields()
              return {
                  name: field for name, field in six.iteritems(all_fields)
                  if isinstance(field, DynamicRelationField) and
                  getattr(field, 'link', True) and
                  not (
                      # Skip sideloaded fields
                      name in self.fields and
                      self.is_field_sideloaded(name)
                  ) and not (
                      # Skip included single relations
                      # TODO: Use links, when we can generate canonical URLs
                      name in self.fields and
                      not getattr(field, 'many', False)
                  )
              }
docs: Construct dict of name:field for linkable fields.