From 3143e6f15ec52be4343062ea40849ace28c0b9ee Mon Sep 17 00:00:00 2001 From: Versun Date: Thu, 29 Feb 2024 06:27:23 +0000 Subject: [PATCH] Update list_display in Translated_ContentAdmin --- django_text_translator/admin.py | 2 +- ...7_remove_translated_content_id_and_more.py | 24 +++++++++++++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 django_text_translator/migrations/0017_remove_translated_content_id_and_more.py diff --git a/django_text_translator/admin.py b/django_text_translator/admin.py index 3a6fd67..4a7072b 100644 --- a/django_text_translator/admin.py +++ b/django_text_translator/admin.py @@ -98,7 +98,7 @@ class ClaudeTranslatorAdmin(BaseTranslatorAdmin): @admin.register(Translated_Content) class Translated_ContentAdmin(admin.ModelAdmin): fields = ["original_content", "translated_content", "translated_language", "tokens", "characters"] - list_display = ["original_content", "translated_language", "translated_content", "tokens", "characters"] + list_display = ["hash", "original_content", "translated_language", "translated_content", "tokens", "characters"] @admin.register(TestTranslator) diff --git a/django_text_translator/migrations/0017_remove_translated_content_id_and_more.py b/django_text_translator/migrations/0017_remove_translated_content_id_and_more.py new file mode 100644 index 0000000..95af69f --- /dev/null +++ b/django_text_translator/migrations/0017_remove_translated_content_id_and_more.py @@ -0,0 +1,24 @@ +# Generated by Django 5.0.2 on 2024-02-29 06:25 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ("translator", "0016_alter_deeplwebtranslator_max_characters_and_more"), + ] + + operations = [ + migrations.RemoveField( + model_name="translated_content", + name="id", + ), + migrations.AlterField( + model_name="translated_content", + name="hash", + field=models.BinaryField( + max_length=8, primary_key=True, serialize=False, unique=True + ), + ), + ]