Login
Back to bricks list
Introduction Version

Resource list

RESOURCE
Typing name :  RESOURCE.gws_core.ResourceList Brick :  gws_core v

A list of resources

Resource to manage a list of resources. By default the sytem create a new resource for each resource in the set when saving the set

/!\ for now this resource is only used for DynamicIO. It is not really supposed to be saved in the DB

Views

RESOURCES LIST - view_resources_list()Default view
List the resources
VIEW RESOURCE - view_as_json()
View the complete resource as json

Functions

__INIT__

Constructor, please do not overwrite this method, use the init method instead Leave the constructor without parameters.

Parameters:
NameTypeDefault valueDescription
resourcesList None
ADD_TECHNICAL_INFO

Add a technical information to the resource

Parameters:
NameTypeDefault valueDescription
technical_infoTechnicalInfo
APPEND
Parameters:
NameTypeDefault valueDescription
itemAny
CHECK_RESOURCE

You can redefine this method to define custom logic to check this resource. If there is a problem with the resource, return a string that define the error, otherwise return None This method is called on output resources of a task. If there is an error returned, the task will be set to error and next proceses will not be run. It is also call when uploading a resource (usually for files or folder), if there is an error returned, the resource will not be uploaded

Return type:
Union[str, NoneType]
CLEAR
CLONE

Clone the resource to create a new instance with a new id. It copies the RFields.

Return type:
ResourceType
COPY
COUNT
Parameters:
NameTypeDefault valueDescription
itemAny
EXTEND
Parameters:
NameTypeDefault valueDescription
itemAny
GET_DEFAULT_NAME

You can redefine this method to set a name of the resource. When saving the resource the name will be saved automatically This can be useful to distinguish this resource from another one or to search for the resource

Return type:
str
GET_RESOURCE_IDS
Return type:
Set
GET_RESOURCES
Return type:
List
GET_RESOURCES_AS_SET
Return type:
Set
GET_TECHNICAL_INFO

Get the technical information of the resource

Parameters:
NameTypeDefault valueDescription
keystr
Return type:
TechnicalInfo
INDEX
Parameters:
NameTypeDefault valueDescription
itemAny
INIT

This can be overwritten to perform custom initialization of the resource. This method is called just after the init (constructor) of the resource. The default values of RFields are set before this method is called.

INSERT
Parameters:
NameTypeDefault valueDescription
indexAny
itemAny
IS_EMPTY
Return type:
bool
POP
Parameters:
NameTypeDefault valueDescription
indexstr None
REMOVE
Parameters:
NameTypeDefault valueDescription
itemAny
REVERSE
SORT
Parameters:
NameTypeDefault valueDescription
keystr None
reversebool False
TO_LIST
Return type:
List