fix: 修复代码生成字段唯一性校验dao层模板判断异常的问题

This commit is contained in:
insistence
2025-02-26 09:00:35 +08:00
parent ca641055e0
commit 8ce598ad54

View File

@@ -70,7 +70,7 @@ class {{ BusinessName }}Dao:
await db.execute(
select({{ ClassName }}).where(
{% for column in columns %}
{% if column.required %}
{% if column.unique %}
{{ ClassName }}.{{ column.python_field | camel_to_snake }} == {{ businessName }}.{{ column.python_field | camel_to_snake }} if {{ businessName }}.{{ column.python_field | camel_to_snake }} else True,
{% endif %}
{% endfor %}