mirror of
https://github.com/ynput/ayon-core.git
synced 2025-12-25 05:14:40 +01:00
numbers can be converted to string for text input and enum
This commit is contained in:
parent
b940d3ba9d
commit
57447f2bfc
2 changed files with 8 additions and 0 deletions
|
|
@ -50,6 +50,8 @@ class EnumEntity(InputEntity):
|
|||
if self.multiselection:
|
||||
if isinstance(value, (set, tuple)):
|
||||
return list(value)
|
||||
elif isinstance(value, (int, float)):
|
||||
return str(value)
|
||||
return NOT_SET
|
||||
|
||||
def set(self, value):
|
||||
|
|
|
|||
|
|
@ -369,6 +369,12 @@ class TextEntity(InputEntity):
|
|||
self.multiline = self.schema_data.get("multiline", False)
|
||||
self.placeholder_text = self.schema_data.get("placeholder")
|
||||
|
||||
def _convert_to_valid_type(self, value):
|
||||
# Allow numbers converted to string
|
||||
if isinstance(value, (int, float)):
|
||||
return str(value)
|
||||
return NOT_SET
|
||||
|
||||
|
||||
class PathInput(InputEntity):
|
||||
schema_types = ["path-input"]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue