Fix collerek/ormar#588 documentation for distinct keyword to count method

This commit is contained in:
haydeec1
2022-03-17 14:09:46 -04:00
parent 606a592038
commit 11e6f1eecd
7 changed files with 84 additions and 67 deletions

View File

@ -499,11 +499,19 @@ Returns a bool value to confirm if there are rows matching the given criteria
#### count
```python
| async count() -> int
| async count(distinct: bool = True) -> int
```
Returns number of rows matching the given criteria
(applied with `filter` and `exclude` if set before).
If `distinct` is `True` (the default), this will return the number of primary rows selected. If `False`,
the count will be the total number of rows returned
(including extra rows for `one-to-many` or `many-to-many` left `select_related` table joins).
`False` is the legacy (buggy) behavior for workflows that depend on it.
**Arguments**:
- `distinct` (`bool`): flag if the primary table rows should be distinct or not
**Returns**:
@ -865,4 +873,3 @@ Bulk operations do not send signals.
- `objects` (`List[Model]`): list of ormar models
- `columns` (`List[str]`): list of columns to update