(self)
| 1869 | yield val |
| 1870 | |
| 1871 | async def _execute(self) -> list[dict] | dict: |
| 1872 | result = await self._db.execute_query_dict(*self.query.get_parameterized_sql()) |
| 1873 | columns = [ |
| 1874 | val |
| 1875 | for val in [ |
| 1876 | (alias, self.resolve_to_python_value(self.model, field_name)) |
| 1877 | for alias, field_name in self._fields_for_select.items() |
| 1878 | ] |
| 1879 | if not isinstance(val[1], types.LambdaType) |
| 1880 | ] |
| 1881 | |
| 1882 | if columns: |
| 1883 | for row in result: |
| 1884 | for col, func in columns: |
| 1885 | row[col] = func(row[col]) |
| 1886 | |
| 1887 | if self._single: |
| 1888 | if len(result) == 1: |
| 1889 | return result[0] |
| 1890 | if not result: |
| 1891 | if self._raise_does_not_exist: |
| 1892 | raise DoesNotExist(self.model) |
| 1893 | return None # type: ignore |
| 1894 | raise MultipleObjectsReturned(self.model) |
| 1895 | return result |
| 1896 | |
| 1897 | |
| 1898 | class RawSQLQuery(AwaitableQuery): |
no test coverage detected