MCPcopy Index your code
hub / github.com/tortoise/tortoise-orm / ValuesQuery

Class ValuesQuery

tortoise/queryset.py:1766–1895  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1764
1765
1766class ValuesQuery(FieldSelectQuery, Generic[SINGLE]):
1767 __slots__ = (
1768 "_fields_for_select",
1769 "_limit",
1770 "_offset",
1771 "_distinct",
1772 "_orderings",
1773 "_single",
1774 "_raise_does_not_exist",
1775 "_group_bys",
1776 "_force_indexes",
1777 "_use_indexes",
1778 )
1779
1780 def __init__(
1781 self,
1782 model: type[MODEL],
1783 db: BaseDBAsyncClient,
1784 q_objects: list[Q],
1785 single: bool,
1786 raise_does_not_exist: bool,
1787 fields_for_select: dict[str, str],
1788 limit: int | None,
1789 offset: int | None,
1790 distinct: bool,
1791 orderings: list[tuple[str, str]],
1792 annotations: dict[str, Any],
1793 custom_filters: dict[str, FilterInfoDict],
1794 group_bys: tuple[str, ...],
1795 force_indexes: set[str],
1796 use_indexes: set[str],
1797 ) -> None:
1798 super().__init__(model, annotations)
1799 self._fields_for_select = fields_for_select
1800 self._limit = limit
1801 self._offset = offset
1802 self._distinct = distinct
1803 self._orderings = orderings
1804 self._custom_filters = custom_filters
1805 self._q_objects = q_objects
1806 self._single = single
1807 self._raise_does_not_exist = raise_does_not_exist
1808 self._db = db
1809 self._group_bys = group_bys
1810 self._force_indexes = force_indexes
1811 self._use_indexes = use_indexes
1812
1813 def _make_query(self) -> None:
1814 self._joined_tables = []
1815
1816 self.query = copy(self.model._meta.basequery)
1817 for return_as, field in self._fields_for_select.items():
1818 self.add_field_to_select_query(field, return_as)
1819
1820 self.resolve_ordering(
1821 model=self.model,
1822 table=self.model._meta.basetable,
1823 orderings=self._orderings,

Callers 1

valuesMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…