Adding FileUpload control and updated related components
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user