def delete_thumbs(item): """Delete the thumbnails associated with the given item. :param item: A 2-tuple with a subdir name and an ID. If given a ORM mapped class with _thumb_dir and id attributes, the info can be extracted automatically. :type item: ``tuple`` or mapped class instance """ image_dir, item_id = _normalize_thumb_item(item) thumbs = thumb_paths(item, exists=True).itervalues() delete_files(thumbs, image_dir)
def delete(self, unique_id): """Delete the stored file represented by the given unique ID. :type unique_id: unicode :param unique_id: The identifying string for this file. :rtype: boolean :returns: True if successful, False if an error occurred. """ file_path = self._get_path(unique_id) return delete_files([file_path], 'media')