diff --git a/apps/tools/migrations/0001_initial.py b/apps/tools/migrations/0001_initial.py index 83dce27c9b8..c8e7ac471b3 100644 --- a/apps/tools/migrations/0001_initial.py +++ b/apps/tools/migrations/0001_initial.py @@ -62,9 +62,6 @@ class Migration(migrations.Migration): ('scope', models.CharField(choices=[('SHARED', '共享'), ('WORKSPACE', '工作空间可用')], default='WORKSPACE', max_length=20, verbose_name='可用范围')), - ('tool_type', - models.CharField(choices=[('INTERNAL', '内置'), ('PUBLIC', '公开')], default='PUBLIC', max_length=20, - verbose_name='函数类型')), ('template_id', models.UUIDField(default=None, null=True, verbose_name='模版id')), ('workspace_id', models.CharField(default='default', max_length=64, verbose_name='工作空间id', db_index=True)), ('init_params', models.CharField(max_length=102400, null=True, verbose_name='初始化参数')), diff --git a/apps/tools/models/tool.py b/apps/tools/models/tool.py index 89869229741..55bcc18a881 100644 --- a/apps/tools/models/tool.py +++ b/apps/tools/models/tool.py @@ -1,8 +1,8 @@ import uuid_utils.compat as uuid from django.db import models -from .tool_module import ToolModule from users.models import User +from .tool_module import ToolModule class ToolScope(models.TextChoices): @@ -10,11 +10,6 @@ class ToolScope(models.TextChoices): WORKSPACE = "WORKSPACE", "工作空间可用" -class ToolType(models.TextChoices): - INTERNAL = "INTERNAL", '内置' - PUBLIC = "PUBLIC", "公开" - - class Tool(models.Model): id = models.UUIDField(primary_key=True, max_length=128, default=uuid.uuid7, editable=False, verbose_name="主键id") user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="用户id") @@ -27,8 +22,6 @@ class Tool(models.Model): is_active = models.BooleanField(default=True) scope = models.CharField(max_length=20, verbose_name='可用范围', choices=ToolScope.choices, default=ToolScope.WORKSPACE) - tool_type = models.CharField(max_length=20, verbose_name='函数类型', choices=ToolType.choices, - default=ToolType.PUBLIC) template_id = models.UUIDField(max_length=128, verbose_name="模版id", null=True, default=None) module = models.ForeignKey(ToolModule, on_delete=models.CASCADE, verbose_name="模块id", default='root') workspace_id = models.CharField(max_length=64, verbose_name="工作空间id", default="default", db_index=True)