| 1384 | return self |
| 1385 | |
| 1386 | def _legacy_from_self( |
| 1387 | self, *entities: _ColumnsClauseArgument[Any] |
| 1388 | ) -> Self: |
| 1389 | # used for query.count() as well as for the same |
| 1390 | # function in BakedQuery, as well as some old tests in test_baked.py. |
| 1391 | |
| 1392 | fromclause = ( |
| 1393 | self.set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL) |
| 1394 | .correlate(None) |
| 1395 | .subquery() |
| 1396 | ._anonymous_fromclause() |
| 1397 | ) |
| 1398 | |
| 1399 | q = self._from_selectable(fromclause) |
| 1400 | |
| 1401 | if entities: |
| 1402 | q._set_entities(entities) |
| 1403 | return q |
| 1404 | |
| 1405 | @_generative |
| 1406 | def _set_enable_single_crit(self, val: bool) -> Self: |