anytype.ListView
Bases: APIWrapper
Source code in anytype/listview.py
add_objectinlistview(obj)
Add a one object to the current list view.
This method assumes the object are already created and adds them to the current list view context in the space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
Object
|
One Object instances to be added to the list view. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Raises:
Type | Description |
---|---|
Exception
|
If the API call to add objects to the list view fails. |
Source code in anytype/listview.py
add_objectsinlistview(objs)
Add a list of objects to the current list view.
This method assumes the objects are already created and adds them to the current list view context in the space.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
objs
|
list[Object]
|
A list of Object instances to be added to the list view. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Raises:
Type | Description |
---|---|
Exception
|
If the API call to add objects to the list view fails. |
Source code in anytype/listview.py
delete_objectinlistview(obj)
Remove an object from the current list view.
This does not delete the object from the space, only removes its association with the specific list view.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
obj
|
Object
|
The Object instance to be removed from the list view. |
required |
Returns:
Type | Description |
---|---|
None
|
None |
Raises:
Type | Description |
---|---|
Exception
|
If the API call to remove the object from the list view fails. |
Source code in anytype/listview.py
get_objectsinlistview(offset=0, limit=100)
Retrieve a list of objects displayed in the current list view.
Sends a request to the API to fetch objects from a specific list view within a space, using pagination parameters.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
offset
|
int
|
The starting index for pagination. Defaults to 0. |
0
|
limit
|
int
|
The maximum number of objects to retrieve. Defaults to 100. |
100
|
Returns:
Type | Description |
---|---|
list[Object]
|
list[Object]: A list of Object instances parsed from the API response. |