Experiment¶
save(get_level=1, update_existing=False)
¶
Create or update a node in the database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
node |
The node to be saved. |
required | |
get_level |
int
|
Level to recursively get nested nodes. |
1
|
update_existing |
bool
|
Indicates whether to update an existing node with the same unique fields. |
False
|
delete()
¶
Delete a node in the database and clear it locally.
refresh(get_level=1)
¶
Overwrite a node's attributes with the latest values from the database.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
get_level |
int
|
Level to recursively get nested nodes. |
1
|
update(get_level=1, **kwargs)
¶
Updates and immediately saves a node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
get_level |
int
|
Level to recursively get nested nodes. |
1
|
**kwargs |
Arguments to update the node. |
{}
|
create(get_level=1, update_existing=False, **kwargs)
classmethod
¶
Immediately creates a node.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
get_level |
int
|
Level to recursively get nested nodes. |
1
|
update_existing |
bool
|
Indicates whether to update an existing node with the same unique fields. |
False
|
**kwargs |
Arguments for the constructor. |
{}
|
Returns:
Type | Description |
---|---|
cript.data_model.nodes.BaseNode
|
The created node. |
get(get_level=1, **kwargs)
classmethod
¶
Get the JSON for a node and use it to generate a local node object.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
get_level |
int
|
Level to recursively get nested nodes. |
1
|
**kwargs |
Query parameters. |
{}
|
Returns:
Type | Description |
---|---|
cript.data_model.nodes.BaseNode
|
The generated node object. |
search(limit=None, offset=None, get_level=1, **kwargs)
classmethod
¶
Send a query to the API and display the results.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
limit |
Union[int, None]
|
The max number of items to return. |
None
|
offset |
Union[int, None]
|
The starting position of the query. |
None
|
get_level |
int
|
Level to recursively get nested nodes. |
1
|
**kwargs |
Query parameters. |
{}
|
Returns:
Type | Description |
---|---|
cript.data_model.paginator.Paginator
|
A |