Return True/False whether record exists with the provided filter parameters. .. code-block:: python3 result = await User.exists(username="foo") :param using_db: The specific DB connection to use. :param args: Q functions containing constraints. Will be
(
cls: type[MODEL], *args: Q, using_db: BaseDBAsyncClient | None = None, **kwargs: Any
)
| 1589 | |
| 1590 | @classmethod |
| 1591 | def exists( |
| 1592 | cls: type[MODEL], *args: Q, using_db: BaseDBAsyncClient | None = None, **kwargs: Any |
| 1593 | ) -> ExistsQuery: |
| 1594 | """ |
| 1595 | Return True/False whether record exists with the provided filter parameters. |
| 1596 | |
| 1597 | .. code-block:: python3 |
| 1598 | |
| 1599 | result = await User.exists(username="foo") |
| 1600 | |
| 1601 | :param using_db: The specific DB connection to use. |
| 1602 | :param args: Q functions containing constraints. Will be AND'ed. |
| 1603 | :param kwargs: Simple filter constraints. |
| 1604 | """ |
| 1605 | return cls._db_queryset(using_db).filter(*args, **kwargs).exists() |
| 1606 | |
| 1607 | @classmethod |
| 1608 | def get_or_none( |