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

        Args:
            searchtemplate_id: Primary key for a search template database model

        Returns:
            HTTP status 200 if successful, otherwise error messages.
Handles DELETE request to the resource.
Handles DELETE request to the resource .
def delete(self, searchtemplate_id):
        """Handles DELETE request to the resource.

        Args:
            searchtemplate_id: Primary key for a search template database model

        Returns:
            HTTP status 200 if successful, otherwise error messages.
        """
        searchtemplate = SearchTemplate.query.get(searchtemplate_id)
        if not searchtemplate:
            abort(HTTP_STATUS_CODE_NOT_FOUND, 'Search template was not found')

        saved_searches = View.query.filter_by(searchtemplate=searchtemplate)
        for saved_search in saved_searches:
            saved_search.searchtemplate = None

        db_session.delete(searchtemplate)
        db_session.commit()

        return HTTP_STATUS_CODE_OK
def delete ( self , searchtemplate_id ) : searchtemplate = SearchTemplate . query . get ( searchtemplate_id ) if not searchtemplate : abort ( HTTP_STATUS_CODE_NOT_FOUND , 'Search template was not found' ) saved_searches = View . query . filter_by ( searchtemplate = searchtemplate ) for saved_search in saved_searches : saved_search . searchtemplate = None db_session . delete ( searchtemplate ) db_session . commit ( ) return HTTP_STATUS_CODE_OK