code: def serialize_hook(self, instance):
          
          if getattr(instance, 'serialize_hook', None) and callable(instance.serialize_hook):
              return instance.serialize_hook(hook=self)
          if getattr(settings, 'HOOK_SERIALIZER', None):
              serializer = get_module(settings.HOOK_SERIALIZER)
              return serializer(instance, hook=self)
          # if no user defined serializers, fallback to the django builtin!
          data = serializers.serialize('python', [instance])[0]
          for k, v in data.items():
              if isinstance(v, OrderedDict):
                  data[k] = dict(v)
  
          if isinstance(data, OrderedDict):
              data = dict(data)
  
          return {
              'hook': self.dict(),
              'data': data,
          }
docs: Serialize the object down to Python primitives.
  
          By default it uses Django's built in serializer.