Fix the code generation schema template (#706)

This commit is contained in:
Wu Clan
2025-07-01 18:18:47 +08:00
committed by GitHub
parent 54ea301152
commit 7b5ae4696f

View File

@ -10,7 +10,7 @@ from backend.common.schema import SchemaBase
class {{ schema_name }}SchemaBase(SchemaBase):
"""{{ doc_comment }}基础模型"""
{% for model in models %}
{{ model.name }}: {% if model.nullable %}{{ model.pd_type }} | None = Field(None, description='{{ model.comment }}'){% else %}{{ model.pd_type }} = Field(description='{{ model.comment }}'){% endif %}
{{ model.name }}: {% if model.is_nullable %}{{ model.pd_type }} | None = Field(None, description='{{ model.comment }}'){% else %}{{ model.pd_type }} = Field(description='{{ model.comment }}'){% endif %}
{% endfor %}