Skip to content

Commit 09e7c38

Browse files
committed
add translate_status to rssitem
1 parent 6c906f8 commit 09e7c38

File tree

3 files changed

+44
-2
lines changed

3 files changed

+44
-2
lines changed

pythonkr_backend/curation/admin.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ def crawl_selected_feeds(self, request, queryset):
141141

142142
@admin.register(RSSItem)
143143
class RSSItemAdmin(admin.ModelAdmin):
144-
list_display = ('title', 'feed', 'crawling_status', 'author', 'pub_date', 'crawled_at', 'created_at')
145-
list_filter = ('feed', 'crawling_status', 'pub_date', 'created_at', 'author')
144+
list_display = ('title', 'feed', 'crawling_status', 'translate_status', 'author', 'pub_date', 'crawled_at', 'created_at')
145+
list_filter = ('feed', 'crawling_status', 'translate_status', 'pub_date', 'created_at', 'author')
146146
search_fields = ('title', 'description', 'author', 'link')
147147
readonly_fields = ('created_at', 'crawled_at')
148148
date_hierarchy = 'pub_date'
@@ -158,6 +158,9 @@ class RSSItemAdmin(admin.ModelAdmin):
158158
('Crawling Status', {
159159
'fields': ('crawling_status', 'crawled_content', 'crawled_at', 'error_message'),
160160
}),
161+
('Translation Status', {
162+
'fields': ('translate_status', 'translate_error_message'),
163+
}),
161164
('Metadata', {
162165
'fields': ('guid', 'pub_date', 'created_at'),
163166
'classes': ('collapse',)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Generated by Django 5.2.1 on 2025-06-14 08:17
2+
3+
from django.db import migrations, models
4+
5+
6+
class Migration(migrations.Migration):
7+
8+
dependencies = [
9+
('curation', '0013_translatedcontent'),
10+
]
11+
12+
operations = [
13+
migrations.AddField(
14+
model_name='rssitem',
15+
name='translate_error_message',
16+
field=models.TextField(blank=True, help_text='번역 실패 시 에러 메시지'),
17+
),
18+
migrations.AddField(
19+
model_name='rssitem',
20+
name='translate_status',
21+
field=models.CharField(choices=[('pending', '번역 대기'), ('completed', '번역 완료'), ('failed', '번역 실패')], default='pending', help_text='번역 상태', max_length=20),
22+
),
23+
]

pythonkr_backend/curation/models.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,12 @@ class RSSItem(models.Model):
300300
('failed', '크롤링 실패'),
301301
]
302302

303+
TRANSLATE_STATUS_CHOICES = [
304+
('pending', '번역 대기'),
305+
('completed', '번역 완료'),
306+
('failed', '번역 실패'),
307+
]
308+
303309
feed = models.ForeignKey(
304310
RSSFeed,
305311
on_delete=models.CASCADE,
@@ -334,6 +340,16 @@ class RSSItem(models.Model):
334340
blank=True,
335341
help_text="크롤링 실패 시 에러 메시지"
336342
)
343+
translate_status = models.CharField(
344+
max_length=20,
345+
choices=TRANSLATE_STATUS_CHOICES,
346+
default='pending',
347+
help_text="번역 상태"
348+
)
349+
translate_error_message = models.TextField(
350+
blank=True,
351+
help_text="번역 실패 시 에러 메시지"
352+
)
337353
created_at = models.DateTimeField(auto_now_add=True)
338354

339355
def __str__(self):

0 commit comments

Comments
 (0)