Skip to content

Database view

database_view

High-level access to a view saved in Notion.

DatabaseView(*args: Any, **kwargs: Any)

A saved presentation of a Notion data source or a dashboard view.

data_source_id: UUID | None property

Return the ID of the data source presented in the view, if any.

database_id: UUID property

Return the ID of the database container holding the view.

id: UUID property

Return the view's ID.

name: str | None property

Return the view's display name, if present in the response.

type: ViewType property

Return the view's presentation type.

delete() -> None

Delete the saved view from Notion.

delete_query(query_id: UUID | str) -> None

Release cached results without deleting the saved view.

query(*, page_size: int | None = None) -> ViewQuery

Run the saved view and return its first page of page references.

query_results(query_id: UUID | str, *, start_cursor: str | None = None, page_size: int | None = None) -> ViewQueryResultList

Return the next page of references using the cursor from a cached query.

update(*, name: str | None = None, **settings: Unpack[ViewSettings]) -> Self

Update the view in Notion. Pass None for a nullable setting to clear it.