Skip to content

Commit 8cf7419

Browse files
committed
Convert a few notes to tip
1 parent 43f411c commit 8cf7419

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

docs/api-guide/generic-views.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,8 +96,8 @@ For example:
9696
user = self.request.user
9797
return user.accounts.all()
9898

99-
!!! note
100-
If the `serializer_class` used in the generic view spans orm relations, leading to an n+1 problem, you could optimize your queryset in this method using `select_related` and `prefetch_related`. To get more information about n+1 problem and use cases of the mentioned methods refer to related section in [django documentation][django-docs-select-related].
99+
!!! tip
100+
If the `serializer_class` used in the generic view spans ORM relations, leading to an N+1 problem, you could optimize your queryset in this method using `select_related` and `prefetch_related`. To get more information about N+1 problem and use cases of the mentioned methods refer to related section in [django documentation][django-docs-select-related].
101101

102102
### Avoiding N+1 Queries
103103

docs/api-guide/parsers.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ The set of valid parsers for a view is always defined as a list of classes. Whe
2020
!!! note
2121
When developing client applications always remember to make sure you're setting the `Content-Type` header when sending data in an HTTP request.
2222

23-
If you don't set the content type, most clients will default to using `'application/x-www-form-urlencoded'`, which may not be what you wanted.
23+
If you don't set the content type, most clients will default to using `'application/x-www-form-urlencoded'`, which may not be what you want.
2424

2525
As an example, if you are sending `json` encoded data using jQuery with the [.ajax() method][jquery-ajax], you should make sure to include the `contentType: 'application/json'` setting.
2626

docs/api-guide/relations.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ Relational fields are used to represent model relationships. They can be applie
1515
The relational fields are declared in `relations.py`, but by convention you should import them from the `serializers` module, using `from rest_framework import serializers` and refer to fields as `serializers.<FieldName>`.
1616

1717
!!! note
18-
REST Framework does not attempt to automatically optimize querysets passed to serializers in terms of `select_related` and `prefetch_related` since it would be too much magic. A serializer with a field spanning an orm relation through its source attribute could require an additional database hit to fetch related objects from the database. It is the programmer's responsibility to optimize queries to avoid additional database hits which could occur while using such a serializer.
18+
REST Framework does not attempt to automatically optimize querysets passed to serializers in terms of `select_related` and `prefetch_related` since it would be too much magic. A serializer with a field spanning an ORM relation through its source attribute could require an additional database hit to fetch related objects from the database. It is the programmer's responsibility to optimize queries to avoid additional database hits which could occur while using such a serializer.
1919

2020
For example, the following serializer would lead to a database hit each time evaluating the tracks field if it is not prefetched:
2121

docs/tutorial/1-serialization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ pip install djangorestframework
2626
pip install pygments # We'll be using this for the code highlighting
2727
```
2828

29-
!!! note
29+
!!! tip
3030
To exit the virtual environment at any time, just type `deactivate`. For more information see the [venv documentation][venv].
3131

3232
## Getting started

0 commit comments

Comments
 (0)