code: def wrap_default(self, data, renderer_context):
          
  
          wrapper = self.dict_class()
          view = renderer_context.get("view", None)
          request = renderer_context.get("request", None)
  
          model = self.model_from_obj(view)
          resource_type = self.model_to_resource_type(model)
  
          if isinstance(data, list):
              many = True
              resources = data
          else:
              many = False
              resources = [data]
  
          items = []
          links = self.dict_class()
          linked = self.dict_class()
          meta = self.dict_class()
  
          for resource in resources:
              converted = self.convert_resource(resource, data, request)
              item = converted.get('data', {})
              linked_ids = converted.get('linked_ids', {})
              if linked_ids:
                  item["links"] = linked_ids
              items.append(item)
  
              links.update(converted.get('links', {}))
              linked = self.update_nested(linked,
                                          converted.get('linked', {}))
              meta.update(converted.get('meta', {}))
  
          if many:
              wrapper[resource_type] = items
          else:
              wrapper[resource_type] = items[0]
  
          if links:
              links = self.prepend_links_with_name(links, resource_type)
              wrapper["links"] = links
  
          if linked:
              wrapper["linked"] = linked
  
          if meta:
              wrapper["meta"] = meta
  
          return wrapper
docs: Convert native data to a JSON API resource collection
  
          This wrapper expects a standard DRF data object (a dict-like
          object with a `fields` dict-like attribute), or a list of
          such data objects.