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
The best place to get started with ViewSets and Routers is to take a look at the [newest section in the tutorial][part-6], which demonstrates their usage.
45
+
46
+
## Simpler views
47
+
48
+
This release rationalises the API and implementation of the generic views, dropping the dependancy on Django's `SingleObjectMixin` and `MultipleObjectMixin` classes, removing a number of unneeded attributes, and generally making the implementation more obvious and easy to work with.
49
+
50
+
This improvement is reflected in improved documentation for the `GenericAPIView` base class, and should make it easier to determine how to override methods on the base class if you need to write customized subclasses.
7
51
8
52
## Easier Serializers
9
53
@@ -42,12 +86,6 @@ Similarly, you can now easily include the primary key in hyperlinked relationshi
This release rationalises the API and implementation of the generic views, dropping the dependancy on Django's `SingleObjectMixin` and `MultipleObjectMixin` classes, removing a number of unneeded attributes, and generally making the implementation more obvious and easy to work with.
48
-
49
-
This improvement is reflected in improved documentation for the `GenericAPIView` base class, and should make it easier to determine how to override methods on the base class if you need to write customized subclasses.
50
-
51
89
---
52
90
53
91
# API Changes
@@ -119,7 +157,7 @@ Usage of the old-style attributes continues to be supported, but will raise a `P
119
157
120
158
## Simpler URL lookups
121
159
122
-
The `lookup_field` argument also replaces the `pk_url_kwarg`, `slug_url_kwarg`, and `slug_field` arguments when creating `HyperlinkedRelatedField` instances.
160
+
The `HyperlinkedRelatedField` class now takes a single optional `lookup_field` argument, that replaces the `pk_url_kwarg`, `slug_url_kwarg`, and `slug_field` arguments.
123
161
124
162
For example, you might have a field that references it's relationship by a hyperlink based on a slug field:
125
163
@@ -135,14 +173,6 @@ Usage of the old-style attributes continues to be supported, but will raise a `P
135
173
136
174
For most cases APIs using model fields will behave as previously, however if you are using a custom renderer, not provided by REST framework, then you may now need to add support for rendering `Decimal` instances to your renderer implmentation.
137
175
138
-
## View names and descriptions
139
-
140
-
The mechanics of how view names and descriptions are generated from the docstring and classname has been modified and cleaned up somewhat.
141
-
142
-
If you've been customizing this behavior, for example perhaps to use `rst` markup for the browseable API, then you'll need to take a look at the implementation to see what updates you need to make.
143
-
144
-
Note that the relevant methods have always been private APIs, and the docstrings called them out as intended to be deprecated.
145
-
146
176
## ModelSerializers and reverse relationships
147
177
148
178
The support for adding reverse relationships to the `fields` option on a `ModelSerializer` class means that the `get_related_field` and `get_nested_field` method signatures have now changed.
@@ -151,13 +181,21 @@ In the unlikely event that you're providing a custom serializer class, and imple
151
181
152
182
The old-style signature will continue to function but will raise a `PendingDeprecationWarning`.
153
183
184
+
## View names and descriptions
185
+
186
+
The mechanics of how the names and descriptions used in the browseable API are generated has been modified and cleaned up somewhat.
187
+
188
+
If you've been customizing this behavior, for example perhaps to use `rst` markup for the browseable API, then you'll need to take a look at the implementation to see what updates you need to make.
189
+
190
+
Note that the relevant methods have always been private APIs, and the docstrings called them out as intended to be deprecated.
191
+
154
192
---
155
193
156
194
# Other notes
157
195
158
196
## More explicit style
159
197
160
-
The usage of `model` attribute in generic Views is still supported, but it's usage is being discouraged in favour of the setting the mode explict `queryset` and `serializer_class` attributes.
198
+
The usage of `model` attribute in generic Views is still supported, but it's usage is generally being discouraged throughout the documentation, in favour of the setting the more explict `queryset` and `serializer_class` attributes.
161
199
162
200
For example, the following is now the recommended style for using generic views:
163
201
@@ -184,12 +222,16 @@ It also makes the usage of the `get_queryset()` or `get_serializer_class()` meth
184
222
185
223
## Django 1.3 support
186
224
187
-
The 2.3 release series will be the last series to provide compatiblity with Django 1.3.
225
+
The 2.3.x release series will be the last series to provide compatiblity with Django 1.3.
188
226
189
227
## Version 2.2 API changes
190
228
191
229
All API changes in 2.2 that previously raised `PendingDeprecationWarning` will now raise a `DeprecationWarning`, which is loud by default.
192
230
193
231
## What comes next?
194
232
195
-
The plan for the next few months is to concentrate on addressing outstanding tickets. 2.4 is likely to deal with relatively small refinements to the existing API.
233
+
The next few months should see a renewed focus on addressing outstanding tickets. The 2.4 release is currently planned for around August-September.
0 commit comments