Correct spelling mistakes (#1163)
Co-authored-by: collerek <collerek@gmail.com>
This commit is contained in:
@ -93,7 +93,7 @@ assert album == album2
|
||||
!!!warning
|
||||
Despite being a equivalent row from database the `album` and `album2` in
|
||||
example above are 2 different python objects!
|
||||
Updating one of them will not refresh the second one until you excplicitly load() the
|
||||
Updating one of them will not refresh the second one until you explicitly load() the
|
||||
fresh data from db.
|
||||
|
||||
!!!note
|
||||
|
||||
@ -583,7 +583,7 @@ books = (
|
||||
|
||||
`get(*args, **kwargs) -> Model`
|
||||
|
||||
Get's the first row from the db meeting the criteria set by kwargs.
|
||||
Gets the first row from the db meeting the criteria set by kwargs.
|
||||
|
||||
When any args and/or kwargs are passed it's a shortcut equivalent to calling `filter(*args, **kwargs).get()`
|
||||
|
||||
@ -713,7 +713,7 @@ Ordering in sql will be applied in order of names you provide in order_by.
|
||||
will result in 2 rows of result:
|
||||
```
|
||||
MODEL: 1 - Child Models: [3, 1] # encountered first in result, all children rows combined
|
||||
MODEL: 2 - Child Modles: [2]
|
||||
MODEL: 2 - Child Models: [2]
|
||||
```
|
||||
|
||||
The main model will never duplicate in the result
|
||||
|
||||
@ -33,7 +33,7 @@ To chain related `Models` relation use double underscores between names.
|
||||
!!!note
|
||||
If you are coming from `django` note that `ormar` `select_related` differs ->
|
||||
in `django` you can `select_related`
|
||||
only singe relation types, while in `ormar` you can select related across `ForeignKey`
|
||||
only single relation types, while in `ormar` you can select related across `ForeignKey`
|
||||
relation, reverse side of `ForeignKey` (so virtual auto generated keys) and `ManyToMany`
|
||||
fields (so all relations as of current version).
|
||||
|
||||
|
||||
@ -115,7 +115,7 @@ tracks = await Track.objects.offset(1).limit(1).all()
|
||||
|
||||
`get(**kwargs) -> Model`
|
||||
|
||||
Get's the first row from the db meeting the criteria set by kwargs.
|
||||
Gets the first row from the db meeting the criteria set by kwargs.
|
||||
|
||||
If no criteria is set it will return the last row in db sorted by pk.
|
||||
(The criteria cannot be set also with filter/exclude).
|
||||
@ -166,4 +166,4 @@ objects from other side of the relation.
|
||||
!!!tip
|
||||
To read more about `QuerysetProxy` visit [querysetproxy][querysetproxy] section
|
||||
|
||||
[querysetproxy]: ../relations/queryset-proxy.md
|
||||
[querysetproxy]: ../relations/queryset-proxy.md
|
||||
|
||||
@ -23,7 +23,7 @@ Following methods allow you to load data from the database.
|
||||
|
||||
`get(*args, **kwargs) -> Model`
|
||||
|
||||
Get's the first row from the db meeting the criteria set by kwargs.
|
||||
Gets the first row from the db meeting the criteria set by kwargs.
|
||||
|
||||
If no criteria set it will return the last row in db sorted by pk column.
|
||||
|
||||
@ -99,7 +99,7 @@ assert album == album2
|
||||
!!!warning
|
||||
Despite being an equivalent row from database the `album` and `album2` in
|
||||
example above are 2 different python objects!
|
||||
Updating one of them will not refresh the second one until you excplicitly load() the
|
||||
Updating one of them will not refresh the second one until you explicitly load() the
|
||||
fresh data from db.
|
||||
|
||||
!!!note
|
||||
|
||||
@ -100,7 +100,7 @@ for those models in fields
|
||||
```python hl_lines="1"
|
||||
all_cars = await Car.objects.select_related('manufacturer').fields('id').fields(
|
||||
['name']).all()
|
||||
# all fiels from company model are selected
|
||||
# all fields from company model are selected
|
||||
assert all_cars[0].manufacturer.name == 'Toyota'
|
||||
assert all_cars[0].manufacturer.founded == 1937
|
||||
```
|
||||
@ -263,7 +263,7 @@ for car in all_cars:
|
||||
# models selected in select_related but with no columns in fields list implies all fields
|
||||
all_cars = await Car.objects.select_related('manufacturer').exclude_fields('year').exclude_fields(
|
||||
['gear', 'gearbox_type']).all()
|
||||
# all fiels from company model are selected
|
||||
# all fields from company model are selected
|
||||
assert all_cars[0].manufacturer.name == 'Toyota'
|
||||
assert all_cars[0].manufacturer.founded == 1937
|
||||
|
||||
|
||||
Reference in New Issue
Block a user