@@ -393,7 +393,7 @@ Most of class properties are inherited from
393
393
def query () -> Select[tuple[Self]]
394
394
```
395
395
396
- > Returns a new `sqlalchemy.sql.Select` instance for the model.
396
+ > Return a new `sqlalchemy.sql.Select` for the model.
397
397
398
398
> This is a shortcut for `select(cls )` .
399
399
@@ -419,7 +419,10 @@ def query() -> Select[tuple[Self]]
419
419
def fill(** kwargs) -> Self
420
420
```
421
421
422
- > Fills the object with values from `kwargs` without saving to the database.
422
+ > Fill the object with passed values.
423
+
424
+ > Update the object ' s attributes with the provided values
425
+ > without saving to the database.
423
426
424
427
> ** Parameters**
425
428
@@ -453,7 +456,7 @@ def fill(**kwargs) -> Self
453
456
async def save() -> Self
454
457
```
455
458
456
- > Saves the current row.
459
+ > Save the current row.
457
460
458
461
> ??? + note
459
462
>
@@ -480,7 +483,7 @@ async def save() -> Self
480
483
async def update(** kwargs) -> Self
481
484
```
482
485
483
- > Updates the current row with the provided values.
486
+ > Update the current row with the provided values.
484
487
485
488
> This is the same as calling `self .fill(** kwargs).save()` .
486
489
@@ -509,7 +512,7 @@ async def update(**kwargs) -> Self
509
512
async def delete() -> None
510
513
```
511
514
512
- > Deletes the current row.
515
+ > Delete the current row.
513
516
514
517
> ??? + danger
515
518
>
@@ -551,7 +554,7 @@ async def remove() -> None
551
554
async def insert(** kwargs) -> Self
552
555
```
553
556
554
- > Inserts a new row and returns the saved instance.
557
+ > Insert a new row and return the saved instance.
555
558
556
559
> ** Parameters**
557
560
@@ -585,7 +588,7 @@ async def create(**kwargs) -> Self
585
588
async def save_all(rows: Sequence[Self], refresh: bool = False ) -> None
586
589
```
587
590
588
- > Saves multiple rows in a single transaction.
591
+ > Save multiple rows in a single transaction.
589
592
590
593
> When using this method to update existing rows, instances are not
591
594
> refreshed after commit by default. Accessing the attributes of the
@@ -662,7 +665,7 @@ async def save_all(rows: Sequence[Self], refresh: bool = False) -> None
662
665
async def insert_all(rows: Sequence[Self], refresh: bool = False ) -> None
663
666
```
664
667
665
- > Inserts multiple rows in a single transaction.
668
+ > Insert multiple rows in a single transaction.
666
669
667
670
> This is mostly a shortcut for [`save_all()` ](# save_all)
668
671
> when inserting new rows.
@@ -682,7 +685,7 @@ async def insert_all(rows: Sequence[Self], refresh: bool = False) -> None
682
685
async def update_all(rows: Sequence[Self], refresh: bool = False ) -> None
683
686
```
684
687
685
- > Updates multiple rows in a single transaction.
688
+ > Update multiple rows in a single transaction.
686
689
687
690
> This is mostly a shortcut for [`save_all()` ](# save_all)
688
691
> when updating existing rows.
@@ -706,7 +709,7 @@ async def update_all(rows: Sequence[Self], refresh: bool = False) -> None
706
709
async def delete_all(rows: Sequence[Self]) -> None
707
710
```
708
711
709
- > Deletes multiple rows in a single transaction.
712
+ > Delete multiple rows in a single transaction.
710
713
711
714
> ??? + danger
712
715
>
@@ -742,7 +745,7 @@ async def delete_all(rows: Sequence[Self]) -> None
742
745
async def destroy(* ids: object ) -> None
743
746
```
744
747
745
- > Deletes multiple rows by their primary key.
748
+ > Delete multiple rows by their primary key.
746
749
747
750
> This method can only be used if the model has a single primary key.
748
751
> Otherwise, it will raise a `CompositePrimaryKeyError` exception.
@@ -787,7 +790,7 @@ async def get(
787
790
) -> Self | None
788
791
```
789
792
790
- > Fetches a row by primary key or `None ` if no result is found.
793
+ > Fetch a row by primary key or return `None ` if no result is found.
791
794
792
795
> If multiple results are found, it will raise a
793
796
> `sqlalchemy.exc.MultipleResultsFound` exception.
@@ -837,8 +840,10 @@ async def get_or_fail(
837
840
) -> Self
838
841
```
839
842
840
- > Fetches a row by primary key or raises a `sqlalchemy.exc.NoResultFound`
841
- > exception if no result is found.
843
+ > Fetch a row by primary key.
844
+
845
+ > If no result is found, it will raise a `sqlalchemy.exc.NoResultFound`
846
+ > exception.
842
847
843
848
> If multiple results are found, it will raise a
844
849
> `sqlalchemy.exc.MultipleResultsFound` exception.
@@ -884,7 +889,7 @@ async def get_or_fail(
884
889
async def scalars() -> ScalarResult[Self]
885
890
```
886
891
887
- > Returns a `sqlalchemy.engine.ScalarResult` instance containing all rows.
892
+ > Fetch all rows as scalars .
888
893
889
894
> ** Returns**
890
895
@@ -913,7 +918,7 @@ async def scalars() -> ScalarResult[Self]
913
918
async def first(scalar: bool = True ) -> Self | Row[tuple[Any, ... ]] | None
914
919
```
915
920
916
- > Fetches the first row or `None ` if no results are found.
921
+ > Fetch the first row or return `None ` if no results are found.
917
922
918
923
> If `scalar` is `True ` , returns a scalar value (default).
919
924
@@ -957,8 +962,10 @@ async def first(scalar: bool = True) -> Self | Row[tuple[Any, ...]] | None
957
962
async def one(scalar: bool = True ) -> Self | Row[tuple[Any, ... ]]
958
963
```
959
964
960
- > Fetches one row or raises a `sqlalchemy.exc.NoResultFound` exception
961
- > if no results are found.
965
+ > Fetch one row.
966
+
967
+ > If no result is found, it will raise a `sqlalchemy.exc.NoResultFound`
968
+ > exception.
962
969
963
970
> If multiple results are found, it will raise a
964
971
> `sqlalchemy.exc.MultipleResultsFound` exception.
@@ -1021,7 +1028,7 @@ async def one(scalar: bool = True) -> Self | Row[tuple[Any, ...]]
1021
1028
async def one_or_none(scalar: bool = True ) -> Self | Row[tuple[Any, ... ]] | None
1022
1029
```
1023
1030
1024
- > Fetches one row or `None ` if no results are found.
1031
+ > Fetch one row or return `None ` if no results are found.
1025
1032
1026
1033
> If multiple results are found, it will raise a
1027
1034
> `sqlalchemy.exc.MultipleResultsFound` exception.
@@ -1083,7 +1090,7 @@ async def one_or_none(scalar: bool = True) -> Self | Row[tuple[Any, ...]] | None
1083
1090
async def all (scalars: bool = True ) -> Sequence[Self] | Sequence[Row[tuple[Any, ... ]]]
1084
1091
```
1085
1092
1086
- > Fetches all rows.
1093
+ > Fetch all rows.
1087
1094
1088
1095
> If `scalars` is `True ` , returns scalar values (default).
1089
1096
@@ -1126,7 +1133,7 @@ async def all(scalars: bool = True) -> Sequence[Self] | Sequence[Row[tuple[Any,
1126
1133
async def count() -> int
1127
1134
```
1128
1135
1129
- > Fetches the number of rows.
1136
+ > Fetch the number of rows.
1130
1137
1131
1138
> ** Returns**
1132
1139
@@ -1147,8 +1154,7 @@ async def count() -> int
1147
1154
async def unique(scalars: bool = True ) -> ScalarResult[Self] | Result[tuple[Any, ... ]]
1148
1155
```
1149
1156
1150
- > Similar to [`scalars()` ](# scalars) but applies unique filtering to
1151
- > the objects returned in the result instance.
1157
+ > Return rows with unique filtering applied.
1152
1158
1153
1159
> If `scalars` is `False ` , returns a `sqlalchemy.engine.Result` instance
1154
1160
> instead of a `sqlalchemy.engine.ScalarResult` instance.
@@ -1191,9 +1197,7 @@ async def unique(scalars: bool = True) -> ScalarResult[Self] | Result[tuple[Any,
1191
1197
async def unique_first(scalar: bool = True ) -> Self | Row[tuple[Any, ... ]] | None
1192
1198
```
1193
1199
1194
- > Similar to [`first()` ](# first) but applies unique filtering to
1195
- > the objects returned by either `sqlalchemy.engine.ScalarResult`
1196
- > or `sqlalchemy.engine.Result` depending on the value of `scalar` .
1200
+ > Similar to `first()` with unique filtering applied.
1197
1201
1198
1202
> ??? + note
1199
1203
>
@@ -1211,9 +1215,7 @@ async def unique_first(scalar: bool = True) -> Self | Row[tuple[Any, ...]] | Non
1211
1215
async def unique_one(scalar: bool = True ) -> Self | Row[tuple[Any, ... ]]
1212
1216
```
1213
1217
1214
- > Similar to [`one()` ](# one) but applies unique filtering to
1215
- > the objects returned by either `sqlalchemy.engine.ScalarResult`
1216
- > or `sqlalchemy.engine.Result` depending on the value of `scalar` .
1218
+ > Similar to `one()` with unique filtering applied.
1217
1219
1218
1220
> ??? + note
1219
1221
>
@@ -1231,9 +1233,7 @@ async def unique_one(scalar: bool = True) -> Self | Row[tuple[Any, ...]]
1231
1233
async def unique_one_or_none(scalar: bool = True ) -> Self | Row[tuple[Any, ... ]] | None
1232
1234
```
1233
1235
1234
- > Similar to [`one_or_none()` ](# one_or_none) but applies unique filtering to
1235
- > the objects returned by either `sqlalchemy.engine.ScalarResult`
1236
- > or `sqlalchemy.engine.Result` depending on the value of `scalar` .
1236
+ > Similar to `one_or_none()` with unique filtering applied.
1237
1237
1238
1238
> ??? + note
1239
1239
>
@@ -1252,9 +1252,7 @@ async def unique_one_or_none(scalar: bool = True) -> Self | Row[tuple[Any, ...]]
1252
1252
async def unique_all(scalars: bool = True ) -> Sequence[Self] | Sequence[Row[tuple[Any, ... ]]]
1253
1253
```
1254
1254
1255
- > Similar to [`all ()` ](# all) but applies unique filtering to
1256
- > the objects returned by either `sqlalchemy.engine.ScalarResult`
1257
- > or `sqlalchemy.engine.Result` depending on the value of `scalars` .
1255
+ > Similar to `all ()` with unique filtering applied.
1258
1256
1259
1257
> ??? + note
1260
1258
>
@@ -1272,8 +1270,7 @@ async def unique_all(scalars: bool = True) -> Sequence[Self] | Sequence[Row[tupl
1272
1270
async def unique_count() -> int
1273
1271
```
1274
1272
1275
- > Similar to [`count()` ](# count) but applies unique filtering to
1276
- > the objects returned by `sqlalchemy.engine.ScalarResult` .
1273
+ > Similar to `count()` with unique filtering applied.
1277
1274
1278
1275
> ??? + note
1279
1276
>
@@ -1291,7 +1288,7 @@ async def unique_count() -> int
1291
1288
def select(* entities: _ColumnsClauseArgument[Any]) -> AsyncQuery[Self]
1292
1289
```
1293
1290
1294
- > Replaces the columns clause with the given entities.
1291
+ > Replace the columns clause with the given entities.
1295
1292
1296
1293
> The existing set of FROMs are maintained, including those implied by
1297
1294
> the current columns clause.
@@ -1322,7 +1319,7 @@ def select(*entities: _ColumnsClauseArgument[Any]) -> AsyncQuery[Self]
1322
1319
def distinct() -> AsyncQuery[Self]
1323
1320
```
1324
1321
1325
- > Applies DISTINCT to the SELECT statement overall.
1322
+ > Apply DISTINCT to the SELECT statement overall.
1326
1323
1327
1324
> ** Returns**
1328
1325
@@ -1344,7 +1341,7 @@ def distinct() -> AsyncQuery[Self]
1344
1341
def options(* args: ExecutableOption) -> AsyncQuery[Self]
1345
1342
```
1346
1343
1347
- > Applies the given list of mapper options.
1344
+ > Apply the given list of mapper options.
1348
1345
1349
1346
> ??? + warning
1350
1347
>
@@ -1419,7 +1416,7 @@ def options(*args: ExecutableOption) -> AsyncQuery[Self]
1419
1416
def where(* criteria: ColumnElement[bool ], ** filters: Any) -> AsyncQuery[Self]
1420
1417
```
1421
1418
1422
- > Applies one or more WHERE criteria to the query.
1419
+ > Apply one or more WHERE criteria to the query.
1423
1420
1424
1421
> It supports both Django- like syntax and SQLAlchemy syntax.
1425
1422
@@ -1489,7 +1486,7 @@ def search(
1489
1486
) -> AsyncQuery[Self]
1490
1487
```
1491
1488
1492
- > Applies a search filter to the query.
1489
+ > Apply a search filter to the query.
1493
1490
1494
1491
> Searches for `search_term` in the
1495
1492
> [searchable columns](inspection- mixin.md# searchable_attributes) of the model.
@@ -1544,7 +1541,7 @@ def search(
1544
1541
def order_by(* columns: ColumnExpressionOrStrLabelArgument[Any]) -> AsyncQuery[Self]
1545
1542
```
1546
1543
1547
- > Applies one or more ORDER BY criteria to the query.
1544
+ > Apply one or more ORDER BY criteria to the query.
1548
1545
1549
1546
> It supports both Django- like syntax and SQLAlchemy syntax.
1550
1547
@@ -1601,7 +1598,7 @@ def group_by(
1601
1598
) -> AsyncQuery[Self]
1602
1599
```
1603
1600
1604
- > Applies one or more GROUP BY criteria to the query.
1601
+ > Apply one or more GROUP BY criteria to the query.
1605
1602
1606
1603
> It supports both Django- like syntax and SQLAlchemy syntax.
1607
1604
@@ -1651,7 +1648,7 @@ def group_by(
1651
1648
def offset(offset: int ) -> AsyncQuery[Self]
1652
1649
```
1653
1650
1654
- > Applies an OFFSET clause to the query.
1651
+ > Apply one OFFSET criteria to the query.
1655
1652
1656
1653
> ** Parameters**
1657
1654
@@ -1697,7 +1694,7 @@ def skip(skip: int) -> AsyncQuery[Self]
1697
1694
def limit(limit: int ) -> AsyncQuery[Self]
1698
1695
```
1699
1696
1700
- > Applies a LIMIT clause to the query.
1697
+ > Apply one LIMIT criteria to the query.
1701
1698
1702
1699
> ** Parameters**
1703
1700
@@ -1751,7 +1748,7 @@ def top(top: int) -> AsyncQuery[Self]
1751
1748
def join(* paths: EagerLoadPath) -> AsyncQuery[Self]
1752
1749
```
1753
1750
1754
- > Joined eager loading using LEFT OUTER JOIN .
1751
+ > Apply joined eager loading using LEFT OUTER JOIN .
1755
1752
1756
1753
> When a tuple is passed, the second element must be boolean, and
1757
1754
> if `True ` , the join is `INNER JOIN ` , otherwise `LEFT OUTER JOIN ` .
@@ -1906,7 +1903,7 @@ def with_subquery(*paths: EagerLoadPath) -> AsyncQuery[Self]
1906
1903
def with_schema(schema: EagerSchema) -> AsyncQuery[Self]
1907
1904
```
1908
1905
1909
- > Joined , subqueryload and selectinload eager loading.
1906
+ > Apply joined , subqueryload and selectinload eager loading.
1910
1907
1911
1908
> Useful for complex cases where you need to load nested relationships in
1912
1909
> separate queries.
@@ -1983,9 +1980,9 @@ def smart_query(
1983
1980
) -> AsyncQuery[Self]
1984
1981
```
1985
1982
1986
- > Creates a query combining filtering, sorting, grouping and eager loading .
1987
- > Then, wraps the query into an [ `AsyncQuery` ]( async - query.md) instance and
1988
- > returns it .
1983
+ > Create an async smart query .
1984
+
1985
+ > Smart queries combine filtering, sorting, grouping and eager loading .
1989
1986
1990
1987
> See [`smart_query() from SmartQueryMixin` ](smart- query- mixin.md# smart_query)
1991
1988
> for details.
@@ -1997,8 +1994,7 @@ def smart_query(
1997
1994
def get_async_query(query: Query | None = None ) -> AsyncQuery[Self]
1998
1995
```
1999
1996
2000
- > Returns an `AsyncQuery` instance with the provided
2001
- > `sqlalchemy.sql.Select` instance.
1997
+ > Create an `AsyncQuery` instance.
2002
1998
2003
1999
> If no `sqlalchemy.sql.Select` instance is provided,
2004
2000
> it uses the `query` property of the model.
@@ -2034,7 +2030,7 @@ def get_primary_key_name() -> str
2034
2030
This function is deprecated since version 0.2 and will be removed in future versions.
2035
2031
Use [`primary_key_name` ](inspection- mixin.md# primary_key_name) property instead.
2036
2032
2037
- > Gets the primary key name of the model.
2033
+ > Get the primary key name of the model.
2038
2034
2039
2035
> ??? + warning
2040
2036
>
0 commit comments