Skip to content

Commit 4436507

Browse files
authored
Merge branch 'main' into fix-1126-serialize-missing-pk
2 parents 82bcdc7 + 3b9661e commit 4436507

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+717
-192
lines changed

.readthedocs.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
version: 2
2+
3+
build:
4+
os: "ubuntu-22.04"
5+
tools:
6+
python: "3.8"
7+
8+
sphinx:
9+
configuration: docs/conf.py
10+
11+
python:
12+
install:
13+
- requirements: requirements/requirements-optionals.txt
14+
- requirements: requirements/requirements-documentation.txt
15+
- method: pip
16+
path: .

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ Adam Ziolkowski <[email protected]>
33
Alan Crosswell <[email protected]>
44
Alex Seidmann <[email protected]>
55
Anton Shutik <[email protected]>
6+
Arttu Perälä <[email protected]>
67
Ashley Loewen <[email protected]>
78
Asif Saif Uddin <[email protected]>
89
Beni Keller <[email protected]>

CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,13 @@ any parts of the framework not mentioned in the documentation should generally b
1717
### Changed
1818

1919
* Added support to overwrite serializer methods in customized schema class
20+
* Adjusted some still old formatted strings to f-strings.
21+
* Replaced `OrderedDict` with `dict` which is also ordered since Python 3.7.
2022

2123
### Fixed
2224

2325
* Refactored handling of the `sort` query parameter to fix duplicate declaration in the generated schema definition
26+
* Non-field serializer errors are given a source.pointer value of "/data".
2427
* Serialization of non-model `Serializer` results, e.g. `dict` without a `pk` attribute
2528

2629
## [6.0.0] - 2022-09-24

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
# General information about the project.
6262
project = "Django REST framework JSON:API"
6363
year = datetime.date.today().year
64-
copyright = "{}, Django REST framework JSON:API contributors".format(year)
64+
copyright = f"{year}, Django REST framework JSON:API contributors"
6565
author = "Django REST framework JSON:API contributors"
6666

6767
# The version info for the project you're documenting, acts as replacement for

docs/requirements.txt

-6
This file was deleted.

example/api/serializers/identity.py

+7
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,13 @@ def validate_last_name(self, data):
2323
)
2424
return data
2525

26+
def validate(self, data):
27+
if data["first_name"] == data["last_name"]:
28+
raise serializers.ValidationError(
29+
"First name cannot be the same as last name!"
30+
)
31+
return data
32+
2633
class Meta:
2734
model = auth_models.User
2835
fields = (

example/migrations/0001_initial.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class Migration(migrations.Migration):
6-
76
initial = True
87

98
dependencies = []

example/migrations/0002_taggeditem.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class Migration(migrations.Migration):
6-
76
dependencies = [
87
("contenttypes", "0002_remove_content_type_name"),
98
("example", "0001_initial"),

example/migrations/0003_polymorphics.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class Migration(migrations.Migration):
6-
76
dependencies = [
87
("contenttypes", "0002_remove_content_type_name"),
98
("example", "0002_taggeditem"),

example/migrations/0004_auto_20171011_0631.py

-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33

44

55
class Migration(migrations.Migration):
6-
76
dependencies = [
87
("example", "0003_polymorphics"),
98
]

example/migrations/0005_auto_20180922_1508.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("example", "0004_auto_20171011_0631"),
1110
]

example/migrations/0006_auto_20181228_0752.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("example", "0005_auto_20180922_1508"),
1110
]

example/migrations/0007_artproject_description.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
98
("example", "0006_auto_20181228_0752"),
109
]

example/migrations/0008_labresults.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("example", "0007_artproject_description"),
1110
]

example/migrations/0009_labresults_author.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("example", "0008_labresults"),
1110
]

example/migrations/0010_auto_20210714_0809.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
98
("example", "0009_labresults_author"),
109
]

example/migrations/0011_rename_type_author_author_type_and_more.py

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66

77
class Migration(migrations.Migration):
8-
98
dependencies = [
109
("contenttypes", "0002_remove_content_type_name"),
1110
("example", "0010_auto_20210714_0809"),

example/migrations/0012_author_full_name.py

-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55

66
class Migration(migrations.Migration):
7-
87
dependencies = [
98
("example", "0011_rename_type_author_author_type_and_more"),
109
]

example/serializers.py

-1
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,6 @@ class JSONAPIMeta:
181181

182182

183183
class EntryDRFSerializers(drf_serilazers.ModelSerializer):
184-
185184
tags = TaggedItemDRFSerializer(many=True, read_only=True)
186185
url = drf_serilazers.HyperlinkedIdentityField(
187186
view_name="drf-entry-blog-detail",

0 commit comments

Comments
 (0)