Make QuerySet select for update. Returns a queryset that will lock rows until the end of the transaction, generating a SELECT ... FOR UPDATE SQL statement on supported databases.
(
cls,
nowait: bool = False,
skip_locked: bool = False,
of: tuple[str, ...] = (),
using_db: BaseDBAsyncClient | None = None,
no_key: bool = False,
)
| 1319 | |
| 1320 | @classmethod |
| 1321 | def select_for_update( |
| 1322 | cls, |
| 1323 | nowait: bool = False, |
| 1324 | skip_locked: bool = False, |
| 1325 | of: tuple[str, ...] = (), |
| 1326 | using_db: BaseDBAsyncClient | None = None, |
| 1327 | no_key: bool = False, |
| 1328 | ) -> QuerySet[Self]: |
| 1329 | """ |
| 1330 | Make QuerySet select for update. |
| 1331 | |
| 1332 | Returns a queryset that will lock rows until the end of the transaction, |
| 1333 | generating a SELECT ... FOR UPDATE SQL statement on supported databases. |
| 1334 | """ |
| 1335 | return cls._db_queryset(using_db, for_write=True).select_for_update( |
| 1336 | nowait, skip_locked, of, no_key=no_key |
| 1337 | ) |
| 1338 | |
| 1339 | @classmethod |
| 1340 | async def update_or_create( |