Skip to content

Commit

Permalink
Update folder type field in creator_plugins.py
Browse files Browse the repository at this point in the history
Added enum_resolver and description to folder_type field for better clarity and functionality.
  • Loading branch information
jakubjezek001 committed Nov 15, 2024
1 parent 303efed commit f199802
Showing 1 changed file with 14 additions and 4 deletions.
18 changes: 14 additions & 4 deletions server/settings/creator_plugins.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -175,7 +185,7 @@ class IngestCSVPluginModel(BaseSettingsModel):
folder_creation_config: FolderCreationConfigModel = SettingsField(
title="Folder creation config",
default_factory=FolderCreationConfigModel
)
)


class TrayPublisherCreatePluginsModel(BaseSettingsModel):
Expand Down Expand Up @@ -372,6 +382,6 @@ class TrayPublisherCreatePluginsModel(BaseSettingsModel):
{"regex": "(sh.*)", "folder_type": "Shot"},
{"regex": "(seq.*)", "folder_type": "Sequence"}
],
}
}
}
}

0 comments on commit f199802

Please sign in to comment.