Skip to content

Commit e57a217

Browse files
committed
Removed deprecated '.model' docs
1 parent f2f1425 commit e57a217

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

docs/api-guide/generic-views.md

+2-6
Original file line numberDiff line numberDiff line change
@@ -93,17 +93,13 @@ The following attributes are used to control pagination when used with list view
9393

9494
* `filter_backends` - A list of filter backend classes that should be used for filtering the queryset. Defaults to the same value as the `DEFAULT_FILTER_BACKENDS` setting.
9595

96-
**Deprecated attributes**:
97-
98-
* `model` - This shortcut may be used instead of setting either (or both) of the `queryset`/`serializer_class` attributes. The explicit style is preferred over the `.model` shortcut, and usage of this attribute is now deprecated.
99-
10096
### Methods
10197

10298
**Base methods**:
10399

104100
#### `get_queryset(self)`
105101

106-
Returns the queryset that should be used for list views, and that should be used as the base for lookups in detail views. Defaults to returning the queryset specified by the `queryset` attribute, or the default queryset for the model if the `model` shortcut is being used.
102+
Returns the queryset that should be used for list views, and that should be used as the base for lookups in detail views. Defaults to returning the queryset specified by the `queryset` attribute.
107103

108104
This method should always be used rather than accessing `self.queryset` directly, as `self.queryset` gets evaluated only once, and those results are cached for all subsequent requests.
109105

@@ -153,7 +149,7 @@ For example:
153149

154150
#### `get_serializer_class(self)`
155151

156-
Returns the class that should be used for the serializer. Defaults to returning the `serializer_class` attribute, or dynamically generating a serializer class if the `model` shortcut is being used.
152+
Returns the class that should be used for the serializer. Defaults to returning the `serializer_class` attribute.
157153

158154
May be overridden to provide dynamic behavior, such as using different serializers for read and write operations, or providing different serializers to different types of users.
159155

docs/topics/3.0-announcement.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -665,7 +665,7 @@ This code *would be valid* in `2.4.3`:
665665
class Meta:
666666
model = Account
667667

668-
However this code *would not be valid* in `2.4.3`:
668+
However this code *would not be valid* in `3.0`:
669669

670670
# Missing `queryset`
671671
class AccountSerializer(serializers.Serializer):

0 commit comments

Comments
 (0)