@@ -17,17 +17,21 @@ def __init__(
1717 rql : RQLQuery | None = None ,
1818 order_by : list [str ] | None = None ,
1919 select : list [str ] | None = None ,
20+ * ,
21+ with_render : bool = False ,
2022 ) -> None :
2123 """Initialize the query state with optional filter, ordering, and selection criteria.
2224
2325 Args:
2426 rql: RQL query for filtering data.
2527 order_by: List of fields to order by (prefix with '-' for descending).
2628 select: List of fields to select in the response.
29+ with_render: Whether to include the render() parameter in the query string.
2730 """
2831 self ._filter = rql
2932 self ._order_by = order_by
3033 self ._select = select
34+ self ._with_render = with_render
3135
3236 @property
3337 def filter (self ) -> RQLQuery | None :
@@ -44,6 +48,11 @@ def select(self) -> list[str] | None:
4448 """Get the current select fields."""
4549 return self ._select
4650
51+ @property
52+ def with_render (self ) -> bool :
53+ """Get the current render state."""
54+ return self ._with_render
55+
4756 def build (self , query_params : dict [str , Any ] | None = None ) -> str :
4857 """Build a query string from the current state and additional parameters.
4958
@@ -66,7 +75,11 @@ def build(self, query_params: dict[str, Any] | None = None) -> str:
6675 if self ._filter :
6776 query_parts .append (str (self ._filter ))
6877
78+ if self ._with_render :
79+ query_parts .append ("render()" )
80+
6981 if query_parts :
7082 query = "&" .join (query_parts )
7183 return f"{ query } "
84+
7285 return ""
0 commit comments