code: def update_object(self, obj, data, view_kwargs):
          
          if obj is None:
              url_field = getattr(self, 'url_field', 'id')
              filter_value = view_kwargs[url_field]
              raise ObjectNotFound('{}: {} not found'.format(self.model.__name__, filter_value),
                                   source={'parameter': url_field})
  
          self.before_update_object(obj, data, view_kwargs)
  
          relationship_fields = get_relationships(self.resource.schema, model_field=True)
          nested_fields = get_nested_fields(self.resource.schema, model_field=True)
  
          join_fields = relationship_fields + nested_fields
  
          for key, value in data.items():
              if hasattr(obj, key) and key not in join_fields:
                  setattr(obj, key, value)
  
          self.apply_relationships(data, obj)
          self.apply_nested_fields(data, obj)
  
          try:
              self.session.commit()
          except JsonApiException as e:
              self.session.rollback()
              raise e
          except Exception as e:
              self.session.rollback()
              raise JsonApiException("Update object error: " + str(e), source={'pointer': '/data'})
  
          self.after_update_object(obj, data, view_kwargs)
docs: Update an object through sqlalchemy
  
          :param DeclarativeMeta obj: an object from sqlalchemy
          :param dict data: the data validated by marshmallow
          :param dict view_kwargs: kwargs from the resource view
          :return boolean: True if object have changed else False