-
-
Notifications
You must be signed in to change notification settings - Fork 6.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Version 3.12.5 * Version 3.13 * Version 3.13
- Loading branch information
1 parent
9c97946
commit 7a84dc7
Showing
4 changed files
with
73 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<style> | ||
.promo li a { | ||
float: left; | ||
width: 130px; | ||
height: 20px; | ||
text-align: center; | ||
margin: 10px 30px; | ||
padding: 150px 0 0 0; | ||
background-position: 0 50%; | ||
background-size: 130px auto; | ||
background-repeat: no-repeat; | ||
font-size: 120%; | ||
color: black; | ||
} | ||
.promo li { | ||
list-style: none; | ||
} | ||
</style> | ||
|
||
# Django REST framework 3.13 | ||
|
||
## Django 4.0 support | ||
|
||
The latest release now fully supports Django 4.0. | ||
|
||
Our requirements are now: | ||
|
||
* Python 3.6+ | ||
* Django 4.0, 3.2, 3.1, 2.2 (LTS) | ||
|
||
## Fields arguments are now keyword-only | ||
|
||
When instantiating fields on serializers, you should always use keyword arguments, | ||
such as `serializers.CharField(max_length=200)`. This has always been the case, | ||
and all the examples that we have in the documentation use keyword arguments, | ||
rather than positional arguments. | ||
|
||
From REST framework 3.13 onwards, this is now *explicitly enforced*. | ||
|
||
The most feasible cases where users might be accidentally omitting the keyword arguments | ||
are likely in the composite fields, `ListField` and `DictField`. For instance... | ||
|
||
```python | ||
aliases = serializers.ListField(serializers.CharField()) | ||
``` | ||
|
||
They must now use the more explicit keyword argument style... | ||
|
||
```python | ||
aliases = serializers.ListField(child=serializers.CharField()) | ||
``` | ||
|
||
This change has been made because using positional arguments here *does not* result in the expected behaviour. | ||
|
||
See Pull Request [#7632](https://github.com/encode/django-rest-framework/pull/7632) for more details. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters