code: def handle_current_state(self):
          '''
          Check to see if the current hydrated state and the saved state are different.
  
          If they are, then persist the current state in the database by saving the model instance.
          '''
          if getattr(self, '_current_state_hydrated_changed', False) and self.save_on_change:
              new_base_state = json.dumps(getattr(self, '_current_state_hydrated', {}))
              if new_base_state != self.base_state:
                  self.base_state = new_base_state
                  self.save(f handle_current_state(self):
          '''
          Check to see if the current hydrated state and the saved state are different.
  
          If they are, then persist the current state in the database by saving the model instance.
          '''
          if getattr(self, '_current_state_hydrated_changed', False) and self.save_on_change:
              new_base_state = json.dumps(getattr(self, '_current_state_hydrated', {}))
              if new_base_state != self.base_state:
                  self.base_state = new_base_state
                  self.save()
docs: Check to see if the current hydrated state and the saved state are different.
  
          If they are, then persist the current state in the database by saving the model instance.