code: def owned_post_save(sender, document, **kwargs):
      '''
      Owned mongoengine.post_save signal handler
      Dispatch the `Owned.on_owner_change` signal
      once the document has been saved including the previous owner.
  
      The signal handler should have the following signature:
      ``def handler(document, previous)``
      '''
      if isinstance(document, Owned) and hasattr(document, '_previous_owner'):
          Owned.on_owner_change.send(document, previous=document._previous_ownerf owned_post_save(sender, document, **kwargs):
      '''
      Owned mongoengine.post_save signal handler
      Dispatch the `Owned.on_owner_change` signal
      once the document has been saved including the previous owner.
  
      The signal handler should have the following signature:
      ``def handler(document, previous)``
      '''
      if isinstance(document, Owned) and hasattr(document, '_previous_owner'):
          Owned.on_owner_change.send(document, previous=document._previous_owner)
docs: Owned mongoengine.post_save signal handler
      Dispatch the `Owned.on_owner_change` signal
      once the document has been saved including the previous owner.
  
      The signal handler should have the following signature:
      ``def handler(document, previous)``