diff options
| author | Tom Christie | 2014-08-29 10:03:07 +0100 |
|---|---|---|
| committer | Tom Christie | 2014-08-29 10:03:07 +0100 |
| commit | 8f4ae06b3b3b9572d72529ffad1842f63ca67d91 (patch) | |
| tree | 2fc2c0ce267ae04e69213a810286c8b47b02826f /docs/topics | |
| parent | bb1604674f05c0fa5c62e7bb3e7b9d12fd9bf648 (diff) | |
| parent | 8b2052172cf7138203e683731c30bd279c6e722a (diff) | |
| download | django-rest-framework-8f4ae06b3b3b9572d72529ffad1842f63ca67d91.tar.bz2 | |
Merge pull request #1784 from tomchristie/remove-model-attribute
Deprecate `.model` attribute on views
Diffstat (limited to 'docs/topics')
| -rw-r--r-- | docs/topics/2.4-accouncement.md | 10 | ||||
| -rw-r--r-- | docs/topics/release-notes.md | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/docs/topics/2.4-accouncement.md b/docs/topics/2.4-accouncement.md index d8e264ff..b6936d2a 100644 --- a/docs/topics/2.4-accouncement.md +++ b/docs/topics/2.4-accouncement.md @@ -15,6 +15,16 @@ The optional authtoken application now includes support for *both* Django 1.7 sc **If you are using authtoken, and you want to continue using `south`, you must upgrade your `south` package to version 1.0.** +## Deprecation of `.model` view attribute + +The `.model` attribute on view classes is an optional shortcut for either or both of `.serializer_class` and `.queryset`. It's usage results in more implicit, less obvious behavior. + +The documentation has previously stated that usage of the more explict style is prefered, and we're now taking that one step further and deprecating the usage of the `.model` shortcut. + +Doing so will mean that there are cases of API code where you'll now need to include a serializer class where you previously were just using the `.model` shortcut. However we firmly believe that it is the right trade-off to make. Removing the shortcut takes away an unneccessary layer of abstraction, and makes your codebase more explict without any significant extra complexity. + +The `DEFAULT_MODEL_SERIALIZER_CLASS` API setting is now also deprecated. + ## Updated test runner We now have a new test runner for developing against the project,, that uses the excellent [py.test](http://pytest.org) library. diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index a2b4782f..c158c47b 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -48,6 +48,7 @@ You can determine your currently installed version using `pip freeze`: * Added compatibility with Django 1.7's database migration support. * New test runner, using `py.test`. +* Deprecated `.model` view attribute in favor of explict `.queryset` and `.serializer_class` attributes. The `DEFAULT_MODEL_SERIALIZER_CLASS` setting is also deprecated. * `@detail_route` and `@list_route` decorators replace `@action` and `@link`. * Support customizable view name and description functions, using the `VIEW_NAME_FUNCTION` and `VIEW_DESCRIPTION_FUNCTION` settings. * Added `NUM_PROXIES` setting for smarter client IP identification. |
