Skip to content

Commit 4cc50ed

Browse files
committed
fix(migrations): 修改文章回溯天数的描述,调整为“1 = 仅昨天,7 = 过去一周”以更准确反映功能
1 parent a7b61f7 commit 4cc50ed

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

core/migrations/0035_alter_openaiagent_max_tokens_digest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Migration(migrations.Migration):
2424
('slug', models.SlugField(blank=True, help_text='URL-friendly version of the name, auto-generated', null=True, unique=True, verbose_name='Slug')),
2525
('description', models.TextField(blank=True, help_text='Optional description of what this digest covers', verbose_name='Description')),
2626
('status', models.BooleanField(editable=False, help_text='Whether the last generation was successful', null=True, verbose_name='Generation Status')),
27-
('days_range', models.IntegerField(default=1, help_text='Number of days to look back for articles (1 = today only, 7 = past week)', verbose_name='Days Range')),
27+
('days_range', models.IntegerField(default=1, help_text='Number of days to look back for articles (1 = yesterday only, 7 = past week)', verbose_name='Days Range')),
2828
('target_language', models.CharField(choices=[('English', 'English'), ('Chinese Simplified', 'Chinese Simplified'), ('Chinese Traditional', 'Chinese Traditional'), ('Russian', 'Russian'), ('Japanese', 'Japanese'), ('Korean', 'Korean'), ('Czech', 'Czech'), ('Danish', 'Danish'), ('German', 'German'), ('Spanish', 'Spanish'), ('French', 'French'), ('Indonesian', 'Indonesian'), ('Italian', 'Italian'), ('Hungarian', 'Hungarian'), ('Norwegian Bokmal', 'Norwegian Bokmal'), ('Dutch', 'Dutch'), ('Polish', 'Polish'), ('Portuguese', 'Portuguese'), ('Swedish', 'Swedish'), ('Turkish', 'Turkish')], default='Chinese Simplified', help_text='Language of the generated digest output', max_length=50, verbose_name='Target Language')),
2929
('prompt', models.TextField(default='\nYou are an editor-in-chief and expert analyst. Create a concise, objective, and well-structured daily digest from multiple articles.\n\nOUTPUT FORMAT\n3–5 categories (auto-generated, short topic names):\n- Header: ## {category}\n- Keep only the most important articles in this category\n- For each kept article:\n - **[Title](LINK_X)**\n > 1–2 sentences, present tense, active voice; highlight novel results/decisions/metrics/impacts; avoid repeated phrasing.\n\nSelection policy (apply strictly):\n- Prioritize significance and real-world impact (e.g., regulatory decisions, major launches, security incidents, funding/M&A, peer-reviewed findings)\n- Prioritize novelty; ignore incremental or routine updates and marketing/promotional posts\n- Prefer credible, primary sources; avoid rumors/speculation\n- Deduplicate across sources; if multiple items cover the same event, keep the most comprehensive one and drop the rest\n- If a category has no important items, skip the category entirely\n\nGeneral rules:\n- Maintain a neutral, objective tone; no content beyond the provided texts\n- Extract facts, named entities, numbers, dates, and concrete outcomes\n- Vary wording across items to avoid repetition\n- Title rewrite (each item): rewrite into {target_language} objectively (no hype/clickbait/exclamations). Do NOT copy source wording; always paraphrase into a concise, neutral title even if the source is already in {target_language}.\n', help_text='AI prompt for generating digest content. Use {digest_name}, {date}, {description}, {target_language} as placeholders', verbose_name='Prompt')),
3030
('is_active', models.BooleanField(default=True, help_text='Whether this digest should be automatically generated', verbose_name='Active')),

core/models/digest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ class Digest(models.Model):
6868
default=1,
6969
verbose_name=_("Days Range"),
7070
help_text=_(
71-
"Number of days to look back for articles (1 = today only, 7 = past week)"
71+
"Number of days to look back for articles (1 = yesterday only, 7 = past week)"
7272
),
7373
)
7474

@@ -223,7 +223,7 @@ def get_articles_for_digest(self):
223223
from datetime import timedelta
224224

225225
end_date = timezone.now()
226-
start_date = end_date - timedelta(days=self.days_range)
226+
start_date = end_date - timedelta(days=self.days_range+1) #由于是凌晨2点,所以包含今天影响不大
227227

228228
# 正确获取digest tags对应的feeds的entries
229229
digest_tags = self.tags.all()

locale/zh_Hans/LC_MESSAGES/django.po

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -479,8 +479,8 @@ msgstr "天数范围"
479479

480480
#: core/models/digest.py:66
481481
msgid ""
482-
"Number of days to look back for articles (1 = today only, 7 = past week)"
483-
msgstr "文章回溯天数(1 = 仅限今日,7 = 过去一周)"
482+
"Number of days to look back for articles (1 = yesterday only, 7 = past week)"
483+
msgstr "文章回溯天数(1 = 仅昨天,7 = 过去一周)"
484484

485485
#: core/models/digest.py:74 templates/admin/feed_batch_modify.html:27
486486
msgid "Target Language"

0 commit comments

Comments
 (0)