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 UsersConfig(AppConfig):
|
||||
default_auto_field = 'django.db.models.BigAutoField'
|
||||
name = 'apps.users'
|
||||
verbose_name = '用户与钱包'
|
||||
|
||||
@@ -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 = [
|
||||
('users', '0003_apikey_userwallet'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AlterModelOptions(
|
||||
name='apikey',
|
||||
options={'ordering': ('-created_at', '-id'), 'verbose_name': 'API 密钥', 'verbose_name_plural': 'API 密钥'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='user',
|
||||
options={'verbose_name': '用户', 'verbose_name_plural': '用户'},
|
||||
),
|
||||
migrations.AlterModelOptions(
|
||||
name='userwallet',
|
||||
options={'ordering': ('user_id',), 'verbose_name': '用户钱包', 'verbose_name_plural': '用户钱包'},
|
||||
),
|
||||
]
|
||||
@@ -34,6 +34,8 @@ class User(AbstractUser):
|
||||
|
||||
class Meta:
|
||||
db_table = "user"
|
||||
verbose_name = "用户"
|
||||
verbose_name_plural = "用户"
|
||||
|
||||
|
||||
class UserWallet(models.Model):
|
||||
@@ -48,6 +50,8 @@ class UserWallet(models.Model):
|
||||
|
||||
class Meta:
|
||||
db_table = "user_wallet"
|
||||
verbose_name = "用户钱包"
|
||||
verbose_name_plural = "用户钱包"
|
||||
ordering = ("user_id",)
|
||||
constraints = [
|
||||
models.CheckConstraint(
|
||||
@@ -86,6 +90,8 @@ class ApiKey(models.Model):
|
||||
|
||||
class Meta:
|
||||
db_table = "api_key"
|
||||
verbose_name = "API 密钥"
|
||||
verbose_name_plural = "API 密钥"
|
||||
ordering = ("-created_at", "-id")
|
||||
indexes = [
|
||||
models.Index(fields=("user", "status")),
|
||||
|
||||
Reference in New Issue
Block a user