Skip to content

Commit 99ca078

Browse files
Ryan P Kilbycarltongibson
authored andcommitted
Add "Community" section to docs, minor cleanup (#5993)
* Add 'Community' tab to navigation, move articles * Drop DRF 2.x announcements and the docs note * Drop embedded tutorial/guide/topics links * Conver mixture of tabs/spaces => spaces * Fix topics/community links
1 parent 7095021 commit 99ca078

27 files changed

+170
-992
lines changed

β€Ždocs/topics/3.0-announcement.md renamed to β€Ždocs/community/3.0-announcement.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ This would now be split out into two separate methods.
119119
instance.save()
120120
return instance
121121

122-
def create(self, validated_data):
122+
def create(self, validated_data):
123123
return Snippet.objects.create(**validated_data)
124124

125125
Note that these methods should return the newly created object instance.
@@ -329,7 +329,7 @@ The `write_only_fields` option on `ModelSerializer` has been moved to `PendingDe
329329
model = MyModel
330330
fields = ('id', 'email', 'notes', 'is_admin')
331331
extra_kwargs = {
332-
'is_admin': {'write_only': True}
332+
'is_admin': {'write_only': True}
333333
}
334334

335335
Alternatively, specify the field explicitly on the serializer class:
@@ -454,15 +454,15 @@ We can now use this class to serialize single `HighScore` instances:
454454
def high_score(request, pk):
455455
instance = HighScore.objects.get(pk=pk)
456456
serializer = HighScoreSerializer(instance)
457-
return Response(serializer.data)
457+
return Response(serializer.data)
458458

459459
Or use it to serialize multiple instances:
460460

461461
@api_view(['GET'])
462462
def all_high_scores(request):
463463
queryset = HighScore.objects.order_by('-score')
464464
serializer = HighScoreSerializer(queryset, many=True)
465-
return Response(serializer.data)
465+
return Response(serializer.data)
466466

467467
##### Read-write `BaseSerializer` classes.
468468

@@ -493,8 +493,8 @@ Here's a complete example of our previous `HighScoreSerializer`, that's been upd
493493
'player_name': 'May not be more than 10 characters.'
494494
})
495495

496-
# Return the validated values. This will be available as
497-
# the `.validated_data` property.
496+
# Return the validated values. This will be available as
497+
# the `.validated_data` property.
498498
return {
499499
'score': int(score),
500500
'player_name': player_name

β€Ždocs/topics/3.1-announcement.md renamed to β€Ždocs/community/3.1-announcement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ If you only wish to support a subset of the supported languages, use Django's st
123123
('en', _('English')),
124124
]
125125

126-
For more details, see the [internationalization documentation](internationalization.md).
126+
For more details, see the [internationalization documentation][internationalization].
127127

128128
Many thanks to [Craig Blaszczyk](https://github.com/jakul) for helping push this through.
129129

@@ -205,5 +205,5 @@ This will either be made as a single 3.2 release, or split across two separate r
205205
[custom-exception-handler]: ../api-guide/exceptions.md#custom-exception-handling
206206
[pagination]: ../api-guide/pagination.md
207207
[versioning]: ../api-guide/versioning.md
208-
[internationalization]: internationalization.md
208+
[internationalization]: ../topics/internationalization.md
209209
[customizing-field-mappings]: ../api-guide/serializers.md#customizing-field-mappings

β€Ždocs/topics/3.2-announcement.md renamed to β€Ždocs/community/3.2-announcement.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ When using `allow_null` with `ListField` or a nested `many=True` serializer the
8383

8484
For example, take the following field:
8585

86-
NestedSerializer(many=True, allow_null=True)
86+
NestedSerializer(many=True, allow_null=True)
8787

8888
Previously the validation behavior would be:
8989

@@ -110,4 +110,4 @@ This release is planned to include:
110110
* Improvements and public API for our templated HTML forms and fields.
111111
* Nested object and list support in HTML forms.
112112

113-
Thanks once again to all our sponsors and supporters.
113+
Thanks once again to all our sponsors and supporters.

β€Ždocs/topics/3.3-announcement.md renamed to β€Ždocs/community/3.3-announcement.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ This brings our supported versions into line with Django's [currently supported
3737
The AJAX based support for the browsable API means that there are a number of internal cleanups in the `request` class. For the vast majority of developers this should largely remain transparent:
3838

3939
* To support form based `PUT` and `DELETE`, or to support form content types such as JSON, you should now use the [AJAX forms][ajax-form] javascript library. This replaces the previous 'method and content type overloading' that required significant internal complexity to the request class.
40-
* The `accept` query parameter is no longer supported by the default content negotiation class. If you require it then you'll need to [use a custom content negotiation class](browser-enhancements.md#url-based-accept-headers).
41-
* The custom `HTTP_X_HTTP_METHOD_OVERRIDE` header is no longer supported by default. If you require it then you'll need to [use custom middleware](browser-enhancements.md#http-header-based-method-overriding).
40+
* The `accept` query parameter is no longer supported by the default content negotiation class. If you require it then you'll need to [use a custom content negotiation class][accept-headers].
41+
* The custom `HTTP_X_HTTP_METHOD_OVERRIDE` header is no longer supported by default. If you require it then you'll need to [use custom middleware][method-override].
4242

4343
The following pagination view attributes and settings have been moved into attributes on the pagination class since 3.1. Their usage was formerly deprecated, and has now been removed entirely, in line with the deprecation policy.
4444

@@ -52,7 +52,9 @@ The following pagination view attributes and settings have been moved into attri
5252

5353
The `ModelSerializer` and `HyperlinkedModelSerializer` classes should now include either a `fields` or `exclude` option, although the `fields = '__all__'` shortcut may be used. Failing to include either of these two options is currently pending deprecation, and will be removed entirely in the 3.5 release. This behavior brings `ModelSerializer` more closely in line with Django's `ModelForm` behavior.
5454

55-
[forms-api]: html-and-forms.md
55+
[forms-api]: ../topics/html-and-forms.md
5656
[ajax-form]: https://github.com/encode/ajax-form
57-
[jsonfield]: ../../api-guide/fields#jsonfield
58-
[django-supported-versions]: https://www.djangoproject.com/download/#supported-versions
57+
[jsonfield]: ../api-guide/fields#jsonfield
58+
[accept-headers]: ../topics/browser-enhancements.md#url-based-accept-headers
59+
[method-override]: ../topics/browser-enhancements.md#http-header-based-method-overriding
60+
[django-supported-versions]: https://www.djangoproject.com/download/#supported-versions

β€Ždocs/topics/3.4-announcement.md renamed to β€Ždocs/community/3.4-announcement.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,10 @@ The full set of itemized release notes [are available here][release-notes].
185185
[swagger]: https://openapis.org/specification
186186
[hyperschema]: http://json-schema.org/latest/json-schema-hypermedia.html
187187
[api-blueprint]: https://apiblueprint.org/
188-
[tut-7]: ../../tutorial/7-schemas-and-client-libraries/
189-
[schema-generation]: ../../api-guide/schemas/
190-
[api-clients]: api-clients.md
188+
[tut-7]: ../tutorial/7-schemas-and-client-libraries/
189+
[schema-generation]: ../api-guide/schemas/
190+
[api-clients]: ../topics/api-clients.md
191191
[milestone]: https://github.com/encode/django-rest-framework/milestone/35
192192
[release-notes]: release-notes#34
193-
[metadata]: ../../api-guide/metadata/#custom-metadata-classes
193+
[metadata]: ../api-guide/metadata/#custom-metadata-classes
194194
[gh3751]: https://github.com/encode/django-rest-framework/issues/3751

β€Ždocs/topics/3.6-announcement.md renamed to β€Ždocs/community/3.6-announcement.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,6 @@ on realtime support, for the 3.7 release.
194194

195195
[sponsors]: https://fund.django-rest-framework.org/topics/funding/#our-sponsors
196196
[funding]: funding.md
197-
[api-docs]: documenting-your-api.md
198-
[js-docs]: api-clients.md#javascript-client-library
199-
[py-docs]: api-clients.md#python-client-library
197+
[api-docs]: ../topics/documenting-your-api.md
198+
[js-docs]: ../topics/api-clients.md#javascript-client-library
199+
[py-docs]: ../topics/api-clients.md#python-client-library
File renamed without changes.

0 commit comments

Comments
Β (0)