Adding FileUpload control and updated related components

This commit is contained in:
2025-11-18 21:54:49 +01:00
parent 3de9aff15c
commit 4199427c71
11 changed files with 179 additions and 11 deletions

View File

@@ -38,6 +38,7 @@ class BaseInstance:
def get_parent(self):
return self._parent
class SingleInstance(BaseInstance):
"""
Base class for instances that can only have one instance at a time.
@@ -107,7 +108,11 @@ class InstancesManager:
if instance_type:
if not issubclass(instance_type, SingleInstance):
assert parent is not None, "Parent instance must be provided if not SingleInstance"
return instance_type(session, parent=parent, *args, **kwargs) # it will be automatically registered
if isinstance(parent, MultipleInstance):
return instance_type(parent, _id=instance_id, *args, **kwargs)
else:
return instance_type(session, parent=parent, *args, **kwargs) # it will be automatically registered
else:
raise