Return the connection that will be used if this query is executed now. :param for_write: Whether this query for write. :return: BaseDBAsyncClient:
(cls, for_write: bool = False)
| 1253 | |
| 1254 | @classmethod |
| 1255 | def _choose_db(cls, for_write: bool = False) -> BaseDBAsyncClient: |
| 1256 | """ |
| 1257 | Return the connection that will be used if this query is executed now. |
| 1258 | |
| 1259 | :param for_write: Whether this query for write. |
| 1260 | :return: BaseDBAsyncClient: |
| 1261 | """ |
| 1262 | if for_write: |
| 1263 | db = router.db_for_write(cls) |
| 1264 | else: |
| 1265 | db = router.db_for_read(cls) |
| 1266 | return db or cls._meta.db |
| 1267 | |
| 1268 | @classmethod |
| 1269 | async def get_or_create( |
no test coverage detected