| 1372 | return self |
| 1373 | |
| 1374 | def _legacy_from_self( |
| 1375 | self, *entities: _ColumnsClauseArgument[Any] |
| 1376 | ) -> Self: |
| 1377 | # used for query.count() as well as for the same |
| 1378 | # function in BakedQuery, as well as some old tests in test_baked.py. |
| 1379 | |
| 1380 | fromclause = ( |
| 1381 | self.set_label_style(LABEL_STYLE_TABLENAME_PLUS_COL) |
| 1382 | .correlate(None) |
| 1383 | .subquery() |
| 1384 | ._anonymous_fromclause() |
| 1385 | ) |
| 1386 | |
| 1387 | q = self._from_selectable(fromclause) |
| 1388 | |
| 1389 | if entities: |
| 1390 | q._set_entities(entities) |
| 1391 | return q |
| 1392 | |
| 1393 | @_generative |
| 1394 | def _set_enable_single_crit(self, val: bool) -> Self: |