feat(generate): 优化代码生成逻辑

- 新增公共字段配置,统一处理常见字段的生成规则
- 修复模板中的一些错误,如变量名、函数名等
- 优化代码结构,提高可读性和可维护性
This commit is contained in:
2025-07-01 23:40:43 +08:00
parent bd13f1cfdc
commit 1c316594f5
10 changed files with 568 additions and 175 deletions

View File

@@ -14,7 +14,7 @@ class {{ class_name }}(BaseModel):
"""
{{ table_comment }}模型
"""
{% for column in columns %}
{% for column in columns if column.is_common == false %}
{%- set params = [] %}
{%- if column.max_length is not none %}{% set params = params + ["max_length=" ~ column.max_length] %}{% endif %}
{%- if column.is_nullable %}{% set params = params + ["null=True"] %}{% endif %}