From 7928e65dc242ca269df261c997b64e863f226e2c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A7=9C=E9=9B=A8=E8=8F=B2?= <2574550132@qq.com> Date: Sun, 9 Nov 2025 22:21:19 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=20whoosh=5Fcn=5Fbackend.py?= =?UTF-8?q?=20=E6=B3=A8=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- djangoblog/whoosh_cn_backend.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/djangoblog/whoosh_cn_backend.py b/djangoblog/whoosh_cn_backend.py index 04e3f7fd..b885613f 100644 --- a/djangoblog/whoosh_cn_backend.py +++ b/djangoblog/whoosh_cn_backend.py @@ -40,17 +40,17 @@ except ImportError: raise MissingDependency( "The 'whoosh' backend requires the installation of 'Whoosh'. Please refer to the documentation.") -# Handle minimum requirement. +#姜雨菲: 检查Whoosh版本,要求2.5.0及以上 if not hasattr(whoosh, '__version__') or whoosh.__version__ < (2, 5, 0): raise MissingDependency( "The 'whoosh' backend requires version 2.5.0 or greater.") -# Bubble up the correct error. - +#姜雨菲:日期时间格式正则表达式,用于解析Whoosh返回的日期时间字符串 DATETIME_REGEX = re.compile( '^(?P\d{4})-(?P\d{2})-(?P\d{2})T(?P\d{2}):(?P\d{2}):(?P\d{2})(\.\d{3,6}Z?)?$') LOCALS = threading.local() -LOCALS.RAM_STORE = None +LOCALS.RAM_STORE = None # 线程本地存储,用于内存存储模式 + class WhooshHtmlFormatter(HtmlFormatter):