module strapi_client.active_document


function DocumentField

DocumentField(*args, unique: bool = False, relation: bool = False, **kwargs)

class ActiveDocument

Experimental ORM class for Strapi document.


property model_extra

Get extra fields set during validation.

Returns: A dictionary of extra fields, or None if config.extra is not set to "allow".


property model_fields_set

Returns the set of fields that have been explicitly set on this model instance.

Returns: A set of strings representing the fields that have been set, i.e. that were not filled from defaults.


method create_document

create_document(client: StrapiClientAsync) → Self

Create new document from object.


method delete_document

delete_document(client: StrapiClientAsync) → None

Delete document attached to object.


classmethod get_document

get_document(
    client: StrapiClientAsync,
    document_id: str,
    populate_all: bool = True
) → Self

Get document by document id.


classmethod get_documents

get_documents(
    client: StrapiClientAsync,
    populate_all: bool = True,
    sort: list[str] | None = None,
    filters: dict[str, Any] | None = None,
    publication_state: str | None = None,
    locale: str | None = None,
    start: int | None = 0,
    page: int | None = None,
    limit: int = 25,
    with_count: bool = True
) → list[Self]

Get list of documents.


method model_dump_variable

model_dump_variable(exclude: set[str] | None = None) → dict[str, Any]

method model_hash

model_hash() → str

method refresh

refresh(client: StrapiClientAsync, populate_all: bool = True) → Self

Refresh object with latest data from Strapi including relations.


method relations_populated

relations_populated() → bool

method set_relations_populated

set_relations_populated(value: bool) → Self

method update_document

update_document(client: StrapiClientAsync) → Self

Update document fields from object.


method upsert_document

upsert_document(client: StrapiClientAsync) → Self

Create document or update fields.


This file was automatically generated via lazydocs.