feat(generate): 优化代码生成逻辑
- 新增公共字段配置,统一处理常见字段的生成规则 - 修复模板中的一些错误,如变量名、函数名等 - 优化代码结构,提高可读性和可维护性
This commit is contained in:
@@ -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 %}
|
||||
|
||||
Reference in New Issue
Block a user