You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api-guide/responses.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ source:
11
11
12
12
REST framework supports HTTP content negotiation by providing a `Response` class which allows you to return content that can be rendered into multiple content types, depending on the client request.
13
13
14
-
The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialised with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content.
14
+
The `Response` class subclasses Django's `SimpleTemplateResponse`. `Response` objects are initialized with data, which should consist of native Python primitives. REST framework then uses standard HTTP content negotiation to determine how it should render the final response content.
15
15
16
16
There's no requirement for you to use the `Response` class, you can also return regular `HttpResponse` or `StreamingHttpResponse` objects from your views if required. Using the `Response` class simply provides a nicer interface for returning content-negotiated Web API responses, that can be rendered to multiple formats.
Copy file name to clipboardExpand all lines: docs/api-guide/serializers.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -155,7 +155,7 @@ When deserializing data, you always need to call `is_valid()` before attempting
155
155
serializer.is_valid()
156
156
# False
157
157
serializer.errors
158
-
# {'email': ['Enter a valid e-mail address.'], 'created': ['This field is required.']}
158
+
# {'email': ['Enter a valid email address.'], 'created': ['This field is required.']}
159
159
160
160
Each key in the dictionary will be the field name, and the values will be lists of strings of any error messages corresponding to that field. The `non_field_errors` key may also be present, and will list any general validation errors. The name of the `non_field_errors` key may be customized using the `NON_FIELD_ERRORS_KEY` REST framework setting.
161
161
@@ -298,7 +298,7 @@ When dealing with nested representations that support deserializing the data, an
298
298
serializer.is_valid()
299
299
# False
300
300
serializer.errors
301
-
# {'user': {'email': ['Enter a valid e-mail address.']}, 'created': ['This field is required.']}
301
+
# {'user': {'email': ['Enter a valid email address.']}, 'created': ['This field is required.']}
302
302
303
303
Similarly, the `.validated_data` property will include nested data structures.
Copy file name to clipboardExpand all lines: docs/api-guide/validators.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -175,7 +175,7 @@ If you want the date field to be entirely hidden from the user, then use `Hidden
175
175
Validators that are applied across multiple fields in the serializer can sometimes require a field input that should not be provided by the API client, but that *is* available as input to the validator.
176
176
For this purposes use `HiddenField`. This field will be present in `validated_data` but *will not* be used in the serializer output representation.
177
177
178
-
**Note:** Using a `read_only=True` field is excluded from writable fields so it won't use a `default=...` argument. Look [3.8 announcement](https://www.django-rest-framework.org/community/3.8-announcement/#altered-the-behaviour-of-read_only-plus-default-on-field).
178
+
**Note:** Using a `read_only=True` field is excluded from writable fields so it won't use a `default=...` argument. Look [3.8 announcement](https://www.django-rest-framework.org/community/3.8-announcement/#altered-the-behavior-of-read_only-plus-default-on-field).
179
179
180
180
REST framework includes a couple of defaults that may be useful in this context.
Copy file name to clipboardExpand all lines: docs/community/3.0-announcement.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -632,7 +632,7 @@ The `MultipleChoiceField` class has been added. This field acts like `ChoiceFiel
632
632
633
633
The `from_native(self, value)` and `to_native(self, data)` method names have been replaced with the more obviously named `to_internal_value(self, data)` and `to_representation(self, value)`.
634
634
635
-
The `field_from_native()` and `field_to_native()` methods are removed. Previously you could use these methods if you wanted to customise the behavior in a way that did not simply lookup the field value from the object. For example...
635
+
The `field_from_native()` and `field_to_native()` methods are removed. Previously you could use these methods if you wanted to customize the behavior in a way that did not simply lookup the field value from the object. For example...
636
636
637
637
def field_to_native(self, obj, field_name):
638
638
"""A custom read-only field that returns the class name."""
Copy file name to clipboardExpand all lines: docs/community/3.15-announcement.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,12 +39,12 @@ By default the URLs created by `SimpleRouter` use regular expressions. This beha
39
39
40
40
Dependency on pytz has been removed and deprecation warnings have been added, Django will provide ZoneInfo instances as long as USE_DEPRECATED_PYTZ is not enabled. More info on the migration can be found [in this guide](https://pytz-deprecation-shim.readthedocs.io/en/latest/migration.html).
41
41
42
-
## Align `SearchFilter`behaviour to `django.contrib.admin` search
42
+
## Align `SearchFilter`behavior to `django.contrib.admin` search
43
43
44
44
Searches now may contain _quoted phrases_ with spaces, each phrase is considered as a single search term, and it will raise a validation error if any null-character is provided in search. See the [Filtering API guide](../api-guide/filtering.md) for more information.
45
45
46
46
## Other fixes and improvements
47
47
48
-
There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behaviour.
48
+
There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behavior.
49
49
50
50
See the [release notes](release-notes.md) page for a complete listing.
Copy file name to clipboardExpand all lines: docs/community/3.16-announcement.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -29,14 +29,14 @@ The current minimum versions of Django is now 4.2 and Python 3.9.
29
29
30
30
## Django LoginRequiredMiddleware
31
31
32
-
The new `LoginRequiredMiddleware` introduced by Django 5.1 can now be used alongside Django REST Framework, however it is not honored for API views as an equivalent behaviour can be configured via `DEFAULT_AUTHENTICATION_CLASSES`. See [our dedicated section](../api-guide/authentication.md#django-51-loginrequiredmiddleware) in the docs for more information.
32
+
The new `LoginRequiredMiddleware` introduced by Django 5.1 can now be used alongside Django REST Framework, however it is not honored for API views as an equivalent behavior can be configured via `DEFAULT_AUTHENTICATION_CLASSES`. See [our dedicated section](../api-guide/authentication.md#django-51-loginrequiredmiddleware) in the docs for more information.
33
33
34
34
## Improved support for UniqueConstraint
35
35
36
36
The generation of validators for [UniqueConstraint](https://docs.djangoproject.com/en/stable/ref/models/constraints/#uniqueconstraint) has been improved to support better nullable fields and constraints with conditions.
37
37
38
38
## Other fixes and improvements
39
39
40
-
There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behaviour.
40
+
There are a number of fixes and minor improvements in this release, ranging from documentation, internal infrastructure (typing, testing, requirements, deprecation, etc.), security and overall behavior.
41
41
42
42
See the [release notes](release-notes.md) page for a complete listing.
0 commit comments