(self, sketch_id, view_id)
return HTTP_STATUS_CODE_OK
Handles DELETE request to the resource.

        Args:
            sketch_id: Integer primary key for a sketch database model
            view_id: Integer primary key for a view database model
Handles DELETE request to the resource.
Handles DELETE request to the resource .
def delete(self, sketch_id, view_id):
        """Handles DELETE request to the resource.

        Args:
            sketch_id: Integer primary key for a sketch database model
            view_id: Integer primary key for a view database model
        """
        sketch = Sketch.query.get_with_acl(sketch_id)
        if not sketch:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND, 'No sketch found with this ID.')

        if not sketch.has_permission(current_user, 'write'):
            abort(HTTP_STATUS_CODE_FORBIDDEN,
                  'User does not have write access controls on sketch.')
        view = View.query.get(view_id)
        if not view:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND, 'No view found with this ID.')

        # Check that this view belongs to the sketch
        if view.sketch_id != sketch.id:
            abort(
                HTTP_STATUS_CODE_NOT_FOUND,
                'The view does not belong to the sketch ({0:d} vs '
                '{1:d})'.format(view.sketch_id, sketch.id))

        if not sketch.has_permission(user=current_user, permission='write'):
            abort(
                HTTP_STATUS_CODE_FORBIDDEN,
                'User does not have write permission on sketch.')

        view.set_status(status='deleted')

        # Update the last activity of a sketch.
        utils.update_sketch_last_activity(sketch)

        return HTTP_STATUS_CODE_OK
def delete ( self , sketch_id , view_id ) : sketch = Sketch . query . get_with_acl ( sketch_id ) if not sketch : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No sketch found with this ID.' ) if not sketch . has_permission ( current_user , 'write' ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'User does not have write access controls on sketch.' ) view = View . query . get ( view_id ) if not view : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'No view found with this ID.' ) # Check that this view belongs to the sketch if view . sketch_id != sketch . id : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'The view does not belong to the sketch ({0:d} vs ' '{1:d})' . format ( view . sketch_id , sketch . id ) ) if not sketch . has_permission ( user = current_user , permission = 'write' ) : abort ( HTTP_STATUS_CODE_FORBIDDEN , 'User does not have write permission on sketch.' ) view . set_status ( status = 'deleted' ) # Update the last activity of a sketch. utils . update_sketch_last_activity ( sketch ) return HTTP_STATUS_CODE_OK