Skip to content

Commit ce16b19

Browse files
committed
fix: 修复代码生成字段唯一性校验dao层模板判断异常的问题
1 parent 1e7724c commit ce16b19

File tree

1 file changed

+1
-1
lines changed
  • ruoyi-fastapi-backend/module_generator/templates/python

1 file changed

+1
-1
lines changed

ruoyi-fastapi-backend/module_generator/templates/python/dao.py.jinja2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ class {{ BusinessName }}Dao:
7070
await db.execute(
7171
select({{ ClassName }}).where(
7272
{% for column in columns %}
73-
{% if column.required %}
73+
{% if column.unique %}
7474
{{ ClassName }}.{{ column.python_field | camel_to_snake }} == {{ businessName }}.{{ column.python_field | camel_to_snake }} if {{ businessName }}.{{ column.python_field | camel_to_snake }} else True,
7575
{% endif %}
7676
{% endfor %}

0 commit comments

Comments
 (0)