def delete_all_notifications_by_kind(kind_name): kind_ref = NotificationKind.get(name=kind_name) (Notification.delete().where(Notification.kind == kind_ref).execute())
def delete_notifications_by_kind(target, kind_name): kind_ref = NotificationKind.get(name=kind_name) Notification.delete().where(Notification.target == target, Notification.kind == kind_ref).execute()
def delete_all_notifications_by_path_prefix(prefix): (Notification.delete().where(Notification.lookup_path**(prefix + "%")).execute())