feat: 中文化 django-admin 分组与表名 (T-602 层1-3)
- 5 个 app 加 AppConfig.verbose_name(中文分组名) - 11 个模型加 Meta.verbose_name/verbose_name_plural(中文表名) - 3 条 AlterModelOptions 迁移(仅 options,无 DB schema 变更) - LANGUAGE_CODE=zh-hans / USE_I18N=True 已在,Django 自带 admin 与 auth 已中文 - 仅显示层,不改字段名/逻辑/表结构 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -4,3 +4,4 @@ from django.apps import AppConfig
|
||||
class AiConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.ai'
|
||||
verbose_name = 'AI 模型配置'
|
||||
|
||||
+25
@@ -0,0 +1,25 @@
|
||||
# Generated by Django 5.2.15 on 2026-07-04 07:08
|
||||
|
||||
from django.db import migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('ai', '0002_aiconfigauditlog'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='aiconfigauditlog',
|
||||
options={'ordering': ('-created_at', '-id'), 'verbose_name': 'AI 配置审计日志', 'verbose_name_plural': 'AI 配置审计日志'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='aimodel',
|
||||
options={'ordering': ('name',), 'verbose_name': 'AI 模型', 'verbose_name_plural': 'AI 模型'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='modelalias',
|
||||
options={'ordering': ('operation_type', 'alias'), 'verbose_name': '能力别名', 'verbose_name_plural': '能力别名'},
|
||||
),
|
||||
]
|
||||
@@ -39,6 +39,8 @@ class AiModel(models.Model):
|
||||
|
||||
class Meta:
|
||||
db_table = "ai_model"
|
||||
verbose_name = "AI 模型"
|
||||
verbose_name_plural = "AI 模型"
|
||||
ordering = ("name",)
|
||||
|
||||
def __str__(self) -> str:
|
||||
@@ -103,6 +105,8 @@ class ModelAlias(models.Model):
|
||||
|
||||
class Meta:
|
||||
db_table = "model_alias"
|
||||
verbose_name = "能力别名"
|
||||
verbose_name_plural = "能力别名"
|
||||
ordering = ("operation_type", "alias")
|
||||
constraints = [
|
||||
models.UniqueConstraint(
|
||||
@@ -163,6 +167,8 @@ class AiConfigAuditLog(models.Model):
|
||||
|
||||
class Meta:
|
||||
db_table = "ai_config_audit_log"
|
||||
verbose_name = "AI 配置审计日志"
|
||||
verbose_name_plural = "AI 配置审计日志"
|
||||
ordering = ("-created_at", "-id")
|
||||
indexes = [
|
||||
models.Index(fields=("target_type", "target_id")),
|
||||
|
||||
Reference in New Issue
Block a user