From 9412e3f34414391644cadbe1a6fceb9784d9afc1 Mon Sep 17 00:00:00 2001 From: insistence <3055204202@qq.com> Date: Fri, 28 Feb 2025 10:46:45 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E4=BB=A3=E7=A0=81?= =?UTF-8?q?=E7=94=9F=E6=88=90=E4=B8=BB=E5=AD=90=E8=A1=A8vo=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E5=8F=AF=E8=83=BD=E7=BC=BA=E5=A4=B1NotBlank=E7=9A=84?= =?UTF-8?q?=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../module_generator/templates/python/vo.py.jinja2 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ruoyi-fastapi-backend/module_generator/templates/python/vo.py.jinja2 b/ruoyi-fastapi-backend/module_generator/templates/python/vo.py.jinja2 index 2b8d5b9..7634980 100644 --- a/ruoyi-fastapi-backend/module_generator/templates/python/vo.py.jinja2 +++ b/ruoyi-fastapi-backend/module_generator/templates/python/vo.py.jinja2 @@ -8,8 +8,8 @@ {% set vo_field_required.has_required = True %} {% endif %} {% endfor %} -{% if table.sub %} {% set sub_vo_field_required = namespace(has_required=False) %} +{% if table.sub %} {% for sub_column in subTable.columns %} {% if sub_column.required %} {% set sub_vo_field_required.has_required = True %} @@ -21,7 +21,7 @@ {% endfor %} from pydantic import BaseModel, ConfigDict, Field from pydantic.alias_generators import to_camel -{% if vo_field_required.has_required %} +{% if vo_field_required.has_required or sub_vo_field_required.has_required %} from pydantic_validation_decorator import NotBlank {% endif %} {% if table.sub %}