API referenceresources

ovok_sdk.resources.content

Project-managed CMS content by content type and language.

  • Stable unknown
  • Release candidate since 0.1.0-rc.4
  • Development since 0.1.0-dev.25+2ba84b0

Project-managed CMS content by content type and language.

ContentResource

ContentResource(http: HttpClient)

Create, read, update and copy the project's CMS content entries.

Every entry is addressed by its content type, language and key. Created by Ovok; access it as ovok.content.

search(content_type: str, language: str, params: QueryParams | None = None) -> Resource

Search the entries of a content type in one language.

Parameters

NameTypeDefaultDescription
content_typestrThe content type, such as "faq".
languagestrThe language code, such as "en".
paramsQueryParams | NoneNoneOptional query parameters passed to the API.

Returns

  • Resource: The search result.

retrieve()

retrieve(content_type: str, language: str, key: str) -> Resource

Read one entry.

Parameters

NameTypeDefaultDescription
content_typestrThe content type.
languagestrThe language code.
keystrThe entry key.

Returns

  • Resource: The entry.

create()

create(content_type: str, language: str, body: Resource) -> Resource

Create an entry.

Parameters

NameTypeDefaultDescription
content_typestrThe content type.
languagestrThe language code.
bodyResourceThe entry as the API takes it.

Returns

  • Resource: The created entry.

update()

update(content_type: str, language: str, key: str, body: Resource) -> Resource

Replace an entry.

Parameters

NameTypeDefaultDescription
content_typestrThe content type.
languagestrThe language code.
keystrThe entry key.
bodyResourceThe new entry.

Returns

  • Resource: The updated entry.

delete()

delete(content_type: str, language: str, key: str) -> None

Delete an entry.

Parameters

NameTypeDefaultDescription
content_typestrThe content type.
languagestrThe language code.
keystrThe entry key.

map()

map(content_type: str, language: str, params: QueryParams | None = None) -> Resource

Read a content type's entries in one language as a key-to-entry map.

Parameters

NameTypeDefaultDescription
content_typestrThe content type.
languagestrThe language code.
paramsQueryParams | NoneNoneOptional query parameters passed to the API.

Returns

  • Resource: The map of entries by key.

copy_from_parent()

copy_from_parent(content_type: str, language: str, key: str) -> Resource

Copy one entry from the parent project into this project.

Parameters

NameTypeDefaultDescription
content_typestrThe content type.
languagestrThe language code.
keystrThe entry key.

Returns

  • Resource: The copied entry.

copy_all_from_parent()

copy_all_from_parent(content_type: str, language: str) -> Resource

Copy every entry of a content type and language from the parent project.

Parameters

NameTypeDefaultDescription
content_typestrThe content type.
languagestrThe language code.

Returns

  • Resource: The API's copy result.

Last updated on

On this page