def delete(self, *_):

        self.authenticator.authenticate(self)

        path = self.split_path(1)
        model_name = path.pop(0)

        model_handler = self.get_model_handler(model_name, "DELETE", 204)
        model_name = model_handler.model_name

        model_key = None
        model_query = None

        if (len(path) > 0):
            model_key = path.pop(0)
        else:
            model_query = ModelQuery()
            model_query.parse(self, model_handler)

            # verify that this type of delete is supported
            if(not self.enable_delete_query):
                logging.warning("query based deletes are currently disabled,"
                                " see 'enable_delete_query' property")
                raise DispatcherException(404)
            elif((model_query.query_expr is None) and
                 (not self.enable_delete_all)):
                logging.warning("'delete all' deletes are currently disabled,"
                                " see 'enable_delete_all' property")
                raise DispatcherException(404)

        try:
            if (model_key is not None):
                model_key = db.Key(model_key)
                self.authorizer.can_delete(self, model_handler.model_type,
                                           model_key)
                self.update_if_match(model_handler, None, (model_key,))
                db.delete(model_key)
            else:
                model_query.query_expr = self.authorizer.check_delete_query(
                    self, model_query.query_expr, model_query.query_params)
                model_handler.delete_all(model_query)

        except Exception, ex:
            if(isinstance(ex, DispatcherException) and (ex.error_code == 412)):
                # we want to throw pre-condition failures
                raise ex
            logging.warning("delete failed", exc_info=1)
            self.error(204)
Does a REST delete.
dataset/ETHPy150Open jahlborn/appengine-rest-server/src/main/python/rest/__init__.py/Dispatcher.delete