MCPcopy
hub / github.com/ormar-orm/ormar / all

Method all

ormar/queryset/queryset.py:1264–1290  ·  view source on GitHub ↗

Returns all rows from a database for given model for set filter options. Passing args and/or kwargs is a shortcut and equals to calling `filter(*args, **kwargs).all()`. If there are no rows meeting the criteria an empty list is returned. :param kwargs: fie

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

Source from the content-addressed store, hash-verified

1262 return await model.update(**kwargs)
1263
1264 async def all(self, *args: Any, **kwargs: Any) -> list["T"]: # noqa: A003
1265 """
1266 Returns all rows from a database for given model for set filter options.
1267
1268 Passing args and/or kwargs is a shortcut and equals to calling
1269 `filter(*args, **kwargs).all()`.
1270
1271 If there are no rows meeting the criteria an empty list is returned.
1272
1273 :param kwargs: fields names and proper value types
1274 :type kwargs: Any
1275 :return: list of returned models
1276 :rtype: list[Model]
1277 """
1278 if kwargs or args:
1279 return await self.filter(*args, **kwargs).all()
1280
1281 expr = self.build_select_expression()
1282 async with self.model_config.database.get_query_executor() as executor:
1283 rows = await executor.fetch_all(expr)
1284 result_rows = await self._process_query_result_rows(rows)
1285 if self._prefetch_related and result_rows:
1286 result_rows = await self._prefetch_related_models(result_rows, rows)
1287 if self._reverse_result:
1288 result_rows.reverse()
1289
1290 return result_rows
1291
1292 async def iterate( # noqa: A003
1293 self,

Callers 15

run_queryFunction · 0.45
run_queryFunction · 0.45
run_queryFunction · 0.45
run_queryFunction · 0.45
run_queryFunction · 0.45
get_itemsFunction · 0.45
sample_dataFunction · 0.45
test_typesFunction · 0.45
test_selecting_subsetFunction · 0.45

Calls 6

filterMethod · 0.95
get_query_executorMethod · 0.80
fetch_allMethod · 0.80