11import uuid_utils .compat as uuid
22from django .db import models
33
4- from .tool_module import ToolModule
54from users .models import User
5+ from .tool_module import ToolModule
66
77
88class ToolScope (models .TextChoices ):
99 SHARED = "SHARED" , '共享'
1010 WORKSPACE = "WORKSPACE" , "工作空间可用"
1111
1212
13- class ToolType (models .TextChoices ):
14- INTERNAL = "INTERNAL" , '内置'
15- PUBLIC = "PUBLIC" , "公开"
16-
17-
1813class Tool (models .Model ):
1914 id = models .UUIDField (primary_key = True , max_length = 128 , default = uuid .uuid7 , editable = False , verbose_name = "主键id" )
2015 user = models .ForeignKey (User , on_delete = models .CASCADE , verbose_name = "用户id" )
@@ -27,8 +22,6 @@ class Tool(models.Model):
2722 is_active = models .BooleanField (default = True )
2823 scope = models .CharField (max_length = 20 , verbose_name = '可用范围' , choices = ToolScope .choices ,
2924 default = ToolScope .WORKSPACE )
30- tool_type = models .CharField (max_length = 20 , verbose_name = '函数类型' , choices = ToolType .choices ,
31- default = ToolType .PUBLIC )
3225 template_id = models .UUIDField (max_length = 128 , verbose_name = "模版id" , null = True , default = None )
3326 module = models .ForeignKey (ToolModule , on_delete = models .CASCADE , verbose_name = "模块id" , default = 'root' )
3427 workspace_id = models .CharField (max_length = 64 , verbose_name = "工作空间id" , default = "default" , db_index = True )
0 commit comments