优化更新

This commit is contained in:
2026-09-13 22:47:31 +08:00
parent cca6743f15
commit 0c67b3e8b5
19 changed files with 51 additions and 51 deletions
@@ -68,9 +68,9 @@
| Django+AntDesign前后端分离版 | 基于 Django、Django ORM、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_AntdVue) |
| Django+NaiveUI前后端分离版 | 基于 Django、Django ORM、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_NaiveVue) |
| Flask+Layui混编版 | 基于 Flask、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_Layui) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| FastAPI+Layui混编版 | 基于 FastAPI、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_Layui) |
| FastAPI+ElementPlus前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_EleVue) |
| FastAPI+AntDesign前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_AntdVue) |
+1 -1
View File
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
+3 -3
View File
@@ -68,9 +68,9 @@
| Django+AntDesign前后端分离版 | 基于 Django、Django ORM、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_AntdVue) |
| Django+NaiveUI前后端分离版 | 基于 Django、Django ORM、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_NaiveVue) |
| Flask+Layui混编版 | 基于 Flask、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_Layui) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| FastAPI+Layui混编版 | 基于 FastAPI、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_Layui) |
| FastAPI+ElementPlus前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_EleVue) |
| FastAPI+AntDesign前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_AntdVue) |
+1 -1
View File
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
@@ -68,9 +68,9 @@
| Django+AntDesign前后端分离版 | 基于 Django、Django ORM、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_AntdVue) |
| Django+NaiveUI前后端分离版 | 基于 Django、Django ORM、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_NaiveVue) |
| Flask+Layui混编版 | 基于 Flask、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_Layui) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| FastAPI+Layui混编版 | 基于 FastAPI、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_Layui) |
| FastAPI+ElementPlus前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_EleVue) |
| FastAPI+AntDesign前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_AntdVue) |
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
@@ -171,7 +171,7 @@ templates/
修改 `templates/models.py.tpl`:
```jinja2
```jinja
{% if f.db_type == 'String' %}
{{ f.name }} = Column(String({{ f.db_args or 255 }}), nullable={{ 'True' if f.nullable else 'False' }}, index=True, comment="{{ f.comment }}")
{% endif %}
@@ -181,7 +181,7 @@ templates/
修改 `templates/service.py.tpl`,在 Service 类中添加钩子方法:
```jinja2
```jinja
class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
# ... 差异点声明 ...
@@ -197,7 +197,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
修改 `templates/ui/columns.ts.tpl`:
```jinja2
```jinja
{% for f in list_fields %}
{
label: '{{ f.label }}',
@@ -215,7 +215,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
在 `templates/` 下新建 `test.py.tpl`:
```jinja2
```jinja
# tests/test_{{ app_name }}.py
import pytest
from modules.{{ app_name }}.service import {{ app_name }}_service
@@ -248,7 +248,7 @@ BACKEND_TEMPLATES = [
## Jinja2 语法速查
```jinja2
```jinja
{# 注释 #}
{# 变量输出 #}
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
@@ -72,9 +72,9 @@
| Django+AntDesign前后端分离版 | 基于 Django、Django ORM、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_AntdVue) |
| Django+NaiveUI前后端分离版 | 基于 Django、Django ORM、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Django_NaiveVue) |
| Flask+Layui混编版 | 基于 Flask、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_Layui) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、Pydantic、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| Flask+ElementPlus前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_EleVue) |
| Flask+AntDesign前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_AntdVue) |
| Flask+NaiveUI前后端分离版 | 基于 Flask、SQLAlchemy、WTForms、Vue3、NaiveUI、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Flask_NaiveVue) |
| FastAPI+Layui混编版 | 基于 FastAPI、Jinja2、Layui 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_Layui) |
| FastAPI+ElementPlus前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、ElementPlus、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_EleVue) |
| FastAPI+AntDesign前后端分离版 | 基于 FastAPI、SQLAlchemy、Pydantic、Vue3、AntDesign、TypeScript、Vite 等技术栈,支持 MySQL、PostgreSQL、SQLite、Oracle、SQL Server 等数据库 | [Gitee地址](https://gitee.com/djangoadmin/DjangoAdmin_Fastapi_AntdVue) |
@@ -171,7 +171,7 @@ templates/
修改 `templates/models.py.tpl`:
```jinja2
```jinja
{% if f.db_type == 'String' %}
{{ f.name }} = Column(String({{ f.db_args or 255 }}), nullable={{ 'True' if f.nullable else 'False' }}, index=True, comment="{{ f.comment }}")
{% endif %}
@@ -181,7 +181,7 @@ templates/
修改 `templates/service.py.tpl`,在 Service 类中添加钩子方法:
```jinja2
```jinja
class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
# ... 差异点声明 ...
@@ -197,7 +197,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
修改 `templates/ui/columns.ts.tpl`:
```jinja2
```jinja
{% for f in list_fields %}
{
label: '{{ f.label }}',
@@ -215,7 +215,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
在 `templates/` 下新建 `test.py.tpl`:
```jinja2
```jinja
# tests/test_{{ app_name }}.py
import pytest
from modules.{{ app_name }}.service import {{ app_name }}_service
@@ -248,7 +248,7 @@ BACKEND_TEMPLATES = [
## Jinja2 语法速查
```jinja2
```jinja
{# 注释 #}
{# 变量输出 #}
+1 -1
View File
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
@@ -171,7 +171,7 @@ templates/
修改 `templates/models.py.tpl`:
```jinja2
```jinja
{% if f.db_type == 'String' %}
{{ f.name }} = Column(String({{ f.db_args or 255 }}), nullable={{ 'True' if f.nullable else 'False' }}, index=True, comment="{{ f.comment }}")
{% endif %}
@@ -181,7 +181,7 @@ templates/
修改 `templates/service.py.tpl`,在 Service 类中添加钩子方法:
```jinja2
```jinja
class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
# ... 差异点声明 ...
@@ -197,7 +197,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
修改 `templates/ui/columns.ts.tpl`:
```jinja2
```jinja
{% for f in list_fields %}
{
label: '{{ f.label }}',
@@ -215,7 +215,7 @@ class {{ model_class_name }}Service(BaseService[{{ model_class_name }}]):
在 `templates/` 下新建 `test.py.tpl`:
```jinja2
```jinja
# tests/test_{{ app_name }}.py
import pytest
from modules.{{ app_name }}.service import {{ app_name }}_service
@@ -248,7 +248,7 @@ BACKEND_TEMPLATES = [
## Jinja2 语法速查
```jinja2
```jinja
{# 注释 #}
{# 变量输出 #}
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
@@ -171,7 +171,7 @@ templates/
修改 `templates/models.py.tpl`:
```jinja2
```jinja
{% if f.db_type == 'String' %}
{{ f.name }} = Column(String({{ f.db_args or 255 }}), nullable={{ 'True' if f.nullable else 'False' }}, index=True, comment="{{ f.comment }}")
{% endif %}
@@ -181,7 +181,7 @@ templates/
修改 `templates/service.py.tpl`,在 Service 类中添加钩子方法:
```jinja2
```jinja
class {{ model_class_name }}Service(BaseService):
repository = {{ model_class_name }}Repository
form = {{ model_class_name }}Form
@@ -201,7 +201,7 @@ class {{ model_class_name }}Service(BaseService):
修改 `templates/ui/columns.ts.tpl`:
```jinja2
```jinja
{% for f in list_fields %}
{
label: '{{ f.label }}',
@@ -219,7 +219,7 @@ class {{ model_class_name }}Service(BaseService):
在 `templates/` 下新建 `test.py.tpl`:
```jinja2
```jinja
# tests/test_{{ app_name }}.py
import pytest
from src.modules.{{ app_name }}.service import {{ app_name }}_service
@@ -253,7 +253,7 @@ BACKEND_TEMPLATES = [
## Jinja2 语法速查
```jinja2
```jinja
{# 注释 #}
{# 变量输出 #}
+1 -1
View File
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
@@ -171,7 +171,7 @@ templates/
修改 `templates/models.py.tpl`:
```jinja2
```jinja
{% if f.db_type == 'String' %}
{{ f.name }} = Column(String({{ f.db_args or 255 }}), nullable={{ 'True' if f.nullable else 'False' }}, index=True, comment="{{ f.comment }}")
{% endif %}
@@ -181,7 +181,7 @@ templates/
修改 `templates/service.py.tpl`,在 Service 类中添加钩子方法:
```jinja2
```jinja
class {{ model_class_name }}Service(BaseService):
repository = {{ model_class_name }}Repository
form = {{ model_class_name }}Form
@@ -201,7 +201,7 @@ class {{ model_class_name }}Service(BaseService):
修改 `templates/ui/columns.ts.tpl`:
```jinja2
```jinja
{% for f in list_fields %}
{
label: '{{ f.label }}',
@@ -219,7 +219,7 @@ class {{ model_class_name }}Service(BaseService):
在 `templates/` 下新建 `test.py.tpl`:
```jinja2
```jinja
# tests/test_{{ app_name }}.py
import pytest
from src.modules.{{ app_name }}.service import {{ app_name }}_service
@@ -253,7 +253,7 @@ BACKEND_TEMPLATES = [
## Jinja2 语法速查
```jinja2
```jinja
{# 注释 #}
{# 变量输出 #}
+1 -1
View File
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]
@@ -171,7 +171,7 @@ templates/
修改 `templates/models.py.tpl`:
```jinja2
```jinja
{% if f.db_type == 'String' %}
{{ f.name }} = Column(String({{ f.db_args or 255 }}), nullable={{ 'True' if f.nullable else 'False' }}, index=True, comment="{{ f.comment }}")
{% endif %}
@@ -181,7 +181,7 @@ templates/
修改 `templates/service.py.tpl`,在 Service 类中添加钩子方法:
```jinja2
```jinja
class {{ model_class_name }}Service(BaseService):
repository = {{ model_class_name }}Repository
form = {{ model_class_name }}Form
@@ -201,7 +201,7 @@ class {{ model_class_name }}Service(BaseService):
修改 `templates/ui/columns.ts.tpl`:
```jinja2
```jinja
{% for f in list_fields %}
{
label: '{{ f.label }}',
@@ -219,7 +219,7 @@ class {{ model_class_name }}Service(BaseService):
在 `templates/` 下新建 `test.py.tpl`:
```jinja2
```jinja
# tests/test_{{ app_name }}.py
import pytest
from src.modules.{{ app_name }}.service import {{ app_name }}_service
@@ -253,7 +253,7 @@ BACKEND_TEMPLATES = [
## Jinja2 语法速查
```jinja2
```jinja
{# 注释 #}
{# 变量输出 #}
+1 -1
View File
@@ -133,7 +133,7 @@ git tag -l
## .gitignore 配置
```gitignore
```ini
# Python
__pycache__/
*.py[cod]