From 16efc5fa454bfe06d574330524bf7cb7930ef1ba Mon Sep 17 00:00:00 2001 From: Shrihari Mahabal Date: Mon, 9 Mar 2026 12:39:56 +0530 Subject: [PATCH] chore: add docstring for get_docs --- frappe/model/document.py | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/frappe/model/document.py b/frappe/model/document.py index 89e06a8a7f..65cb564fc2 100644 --- a/frappe/model/document.py +++ b/frappe/model/document.py @@ -169,9 +169,17 @@ def get_docs( ) -> list["Document"] | Generator[list["Document"]]: """Fetch fully instantiated Document objects from the database. - Returns a list of Documents by default. Pass ``as_generator=True`` to get - a chunked generator that yields a list of Documents per chunk to reduce - peak memory usage. + Returns a list of Documents by default. Pass `as_generator=True` to get + a chunked generator that yields a list of Documents per chunk to reduce memory usage. + + :param doctype: DocType of the records to fetch. + :param filters: Dict or list of filters to apply. + :param chunk_size: Number of records to yield per chunk if using `as_generator`. Default 1000. + :param limit: Maximum total number of records to fetch. + :param limit_start: Start results at record #. Default 0. + :param order_by: Order By string, e.g. `creation desc`. + :param as_generator: If True, returns a generator yielding lists of Documents. + :param for_update: If True, locks the fetched rows for update. """ if is_virtual_doctype(doctype): frappe.throw(_("Virtual DocType {0} cannot be fetched in bulk.").format(doctype))