From f199802fe994c90dc54f74f59cc4fc30852b2451 Mon Sep 17 00:00:00 2001 From: Jakub Jezek Date: Fri, 15 Nov 2024 15:28:54 +0100 Subject: [PATCH] Update folder type field in creator_plugins.py Added enum_resolver and description to folder_type field for better clarity and functionality. --- server/settings/creator_plugins.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/server/settings/creator_plugins.py b/server/settings/creator_plugins.py index 9a3047e..2ba7a23 100644 --- a/server/settings/creator_plugins.py +++ b/server/settings/creator_plugins.py @@ -1,5 +1,9 @@ from pydantic import validator -from ayon_server.settings import BaseSettingsModel, SettingsField +from ayon_server.settings import ( + BaseSettingsModel, + SettingsField, + folder_types_enum +) from ayon_server.settings.validators import ensure_unique_names from ayon_server.exceptions import BadRequestException @@ -131,7 +135,13 @@ def validate_unique_outputs(cls, value): class FolderTypeRegexItem(BaseSettingsModel): _layout = "expanded" regex: str = SettingsField("", title="Folder Regex") - folder_type: str = SettingsField("", title="Folder Type") + folder_type: str = SettingsField( + "Folder", + title="Folder Type", + enum_resolver=folder_types_enum, + description=( + "Project's Anatomy folder type to create when regex matches."), + ) class FolderCreationConfigModel(BaseSettingsModel): @@ -175,7 +185,7 @@ class IngestCSVPluginModel(BaseSettingsModel): folder_creation_config: FolderCreationConfigModel = SettingsField( title="Folder creation config", default_factory=FolderCreationConfigModel - ) + ) class TrayPublisherCreatePluginsModel(BaseSettingsModel): @@ -372,6 +382,6 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel): {"regex": "(sh.*)", "folder_type": "Shot"}, {"regex": "(seq.*)", "folder_type": "Sequence"} ], - } + } } }