From 44ceef841543877a700c3fb4a0f84dfecbad0cbb Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 21 Aug 2013 21:30:25 +0100 Subject: Updating 2.4.0 release notes --- docs/topics/release-notes.md | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'docs/topics') diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 52abfc08..f3bb19c6 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -40,9 +40,12 @@ You can determine your currently installed version using `pip freeze`: ## 2.3.x series -### Master +### 2.4.0 +* `@detail_route` and `@list_route` decorators replace `@action` and `@link`. +* `six` no longer bundled. For Django <= 1.4.1, install `six` package. * Support customizable view name and description functions, using the `VIEW_NAME_FUNCTION` and `VIEW_DESCRIPTION_FUNCTION` settings. +* Bugfix: `?page_size=0` query parameter now falls back to default page size for view, instead of always turning pagination off. ### 2.3.7 -- cgit v1.2.3 From a90796c0f0d9db1a7d9bfaca8fbdfed22435c628 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 13 Jan 2014 09:56:57 +0000 Subject: Track changes that need noting in 2.4 announcement --- docs/topics/2.4-accouncement.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/topics') diff --git a/docs/topics/2.4-accouncement.md b/docs/topics/2.4-accouncement.md index a5425d54..0cf50ce9 100644 --- a/docs/topics/2.4-accouncement.md +++ b/docs/topics/2.4-accouncement.md @@ -1,4 +1,4 @@ * Writable nested serializers. * List/detail routes. * 1.3 Support dropped, install six for <=1.4.?. -* Note title ordering changed \ No newline at end of file +* `allow_none` for char fields -- cgit v1.2.3 From 2911cd64ad67ba193e3d37322ee71692cb482623 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 13 Jan 2014 15:37:52 +0000 Subject: Minor tweaks to 'lookup_value_regex' work --- docs/topics/2.4-accouncement.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/topics') diff --git a/docs/topics/2.4-accouncement.md b/docs/topics/2.4-accouncement.md index 0cf50ce9..91472b9c 100644 --- a/docs/topics/2.4-accouncement.md +++ b/docs/topics/2.4-accouncement.md @@ -2,3 +2,4 @@ * List/detail routes. * 1.3 Support dropped, install six for <=1.4.?. * `allow_none` for char fields +* `trailing_slash = True` --> `[^/]`, `trailing_slash = False` --> `[^/.]`, becomes simply `[^/]` and `lookup_value_regex` is added. -- cgit v1.2.3 From 971578ca345c3d3bae7fd93b87c41d43483b6f05 Mon Sep 17 00:00:00 2001 From: Andreas Pelme Date: Sun, 2 Mar 2014 12:40:30 +0100 Subject: Support for running the test suite with py.test * Get rid of runtests.py * Moved test code from rest_framework/tests and rest_framework/runtests to tests * Invoke py.test from setup.py * Invoke py.test from Travis * Invoke py.test from tox * Changed setUpClass to be just plain setUp in test_permissions.py * Updated contribution guideline to show how to invoke py.test --- docs/topics/contributing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'docs/topics') diff --git a/docs/topics/contributing.md b/docs/topics/contributing.md index 5a5d1a80..09cc00b3 100644 --- a/docs/topics/contributing.md +++ b/docs/topics/contributing.md @@ -65,7 +65,7 @@ To run the tests, clone the repository, and then: pip install -r optionals.txt # Run the tests - rest_framework/runtests/runtests.py + py.test You can also use the excellent `[tox][tox]` testing tool to run the tests against all supported versions of Python and Django. Install `tox` globally, and then simply run: -- cgit v1.2.3 From 15c2c58b43a00ec29af99e0478b70eea57560fce Mon Sep 17 00:00:00 2001 From: Xavier Ordoquy Date: Thu, 1 May 2014 08:43:49 +0200 Subject: Updated the release-notes. --- docs/topics/release-notes.md | 1 + 1 file changed, 1 insertion(+) (limited to 'docs/topics') diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index d6256b38..fd5c7029 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -40,6 +40,7 @@ You can determine your currently installed version using `pip freeze`: ### 2.4.0 +* Use py.test * `@detail_route` and `@list_route` decorators replace `@action` and `@link`. * `six` no longer bundled. For Django <= 1.4.1, install `six` package. * Support customizable view name and description functions, using the `VIEW_NAME_FUNCTION` and `VIEW_DESCRIPTION_FUNCTION` settings. -- cgit v1.2.3 From 3f727ce738776838d8420450ce28485954fbb097 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Tue, 24 Jun 2014 09:02:44 +0200 Subject: Added (first pass) notes to docs & release notes. Backed out `SOUTH_MIGRATION_MODULES` setting from `rest_framework.settings` --- docs/topics/release-notes.md | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 335497ee..5722d45b 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -43,6 +43,14 @@ You can determine your currently installed version using `pip freeze`: ### 2.3.x **Date**: April 2014 +* Added compatibility with Django 1.7's native migrations. + + **IMPORTANT**: In order to continue to use south with Django <1.7 you **must** provide + the `SOUTH_MIGRATION_MODULES` option in your `settings.py`: + + SOUTH_MIGRATION_MODULES = { + 'authtoken': 'rest_framework.authtoken.south_migrations', + } * Fix nested serializers linked through a backward foreign key relation * Fix bad links for the `BrowsableAPIRenderer` with `YAMLRenderer` @@ -165,9 +173,9 @@ You can determine your currently installed version using `pip freeze`: * Added `trailing_slash` option to routers. * Include support for `HttpStreamingResponse`. * Support wider range of default serializer validation when used with custom model fields. -* UTF-8 Support for browsable API descriptions. +* UTF-8 Support for browsable API descriptions. * OAuth2 provider uses timezone aware datetimes when supported. -* Bugfix: Return error correctly when OAuth non-existent consumer occurs. +* Bugfix: Return error correctly when OAuth non-existent consumer occurs. * Bugfix: Allow `FileUploadParser` to correctly filename if provided as URL kwarg. * Bugfix: Fix `ScopedRateThrottle`. @@ -208,7 +216,7 @@ You can determine your currently installed version using `pip freeze`: * Added SearchFilter * Added OrderingFilter * Added GenericViewSet -* Bugfix: Multiple `@action` and `@link` methods now allowed on viewsets. +* Bugfix: Multiple `@action` and `@link` methods now allowed on viewsets. * Bugfix: Fix API Root view issue with DjangoModelPermissions ### 2.3.2 @@ -261,7 +269,7 @@ You can determine your currently installed version using `pip freeze`: * Long HTTP headers in browsable API are broken in multiple lines when possible. * Bugfix: Fix regression with DjangoFilterBackend not worthing correctly with single object views. * Bugfix: OAuth should fail hard when invalid token used. -* Bugfix: Fix serializer potentially returning `None` object for models that define `__bool__` or `__len__`. +* Bugfix: Fix serializer potentially returning `None` object for models that define `__bool__` or `__len__`. ### 2.2.5 -- cgit v1.2.3 From ae2ab496c2fa42ed60d325df4579b1ba38d3bfb5 Mon Sep 17 00:00:00 2001 From: Carlton Gibson Date: Mon, 18 Aug 2014 13:48:46 +0200 Subject: Updated docs for South v1.0 --- docs/topics/release-notes.md | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index 9c87c6c1..b0e5b198 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -42,12 +42,9 @@ You can determine your currently installed version using `pip freeze`: * Added compatibility with Django 1.7's native migrations. - **IMPORTANT**: In order to continue to use south with Django <1.7 you **must** provide - the `SOUTH_MIGRATION_MODULES` option in your `settings.py`: + **IMPORTANT**: In order to continue to use South with Django <1.7 you **must** upgrade to + South v1.0. - SOUTH_MIGRATION_MODULES = { - 'authtoken': 'rest_framework.authtoken.south_migrations', - } * Use py.test * `@detail_route` and `@list_route` decorators replace `@action` and `@link`. * `six` no longer bundled. For Django <= 1.4.1, install `six` package. -- cgit v1.2.3 From 00c0dfc66fd2426a63e6eec498395740b2c3e63b Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 19 Aug 2014 16:29:05 +0100 Subject: Documentation on runtests.py --- docs/topics/contributing.md | 38 ++++++++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/contributing.md b/docs/topics/contributing.md index d33843e1..3400bc8f 100644 --- a/docs/topics/contributing.md +++ b/docs/topics/contributing.md @@ -62,10 +62,44 @@ To run the tests, clone the repository, and then: virtualenv env source env/bin/activate pip install -r requirements.txt - pip install -r optionals.txt + pip install -r requirements-test.txt # Run the tests - py.test + ./runtests.py + +### Test options + +Run using a more concise output style. + + ./runtests -q + +Run the tests using a more concise output style, no coverage, no flake8. + + ./runtests --fast + +Don't run the flake8 code linting. + + ./runtests --nolint + +Only run the flake8 code linting, don't run the tests. + + ./runtests --lintonly + +Run the tests for a given test case. + + ./runtests MyTestCase + +Run the tests for a given test method. + + ./runtests MyTestCase.test_this_method + +Shorter form to run the tests for a given test method. + + ./runtests test_this_method + +Note: The test case and test method matching is fuzzy and will sometimes run other tests that contain a partial string match to the given command line input. + +### Running against multiple environments You can also use the excellent [tox][tox] testing tool to run the tests against all supported versions of Python and Django. Install `tox` globally, and then simply run: -- cgit v1.2.3 From 63d02dbea855a060ec4cdb194497188e2f40cb66 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 19 Aug 2014 17:06:55 +0100 Subject: Drop six from compat. 1.4.2 is now the lowest supported version. --- docs/topics/2.4-accouncement.md | 1 - 1 file changed, 1 deletion(-) (limited to 'docs/topics') diff --git a/docs/topics/2.4-accouncement.md b/docs/topics/2.4-accouncement.md index 91472b9c..cdc99bd5 100644 --- a/docs/topics/2.4-accouncement.md +++ b/docs/topics/2.4-accouncement.md @@ -1,4 +1,3 @@ -* Writable nested serializers. * List/detail routes. * 1.3 Support dropped, install six for <=1.4.?. * `allow_none` for char fields -- cgit v1.2.3 From 0c65e028b604490d498e43083fc3b46da05144fe Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Tue, 19 Aug 2014 23:25:12 +0100 Subject: Release notes --- docs/topics/2.4-accouncement.md | 111 +++++++++++++++++++++++++++++++++++++++- docs/topics/release-notes.md | 21 +++++--- 2 files changed, 124 insertions(+), 8 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/2.4-accouncement.md b/docs/topics/2.4-accouncement.md index cdc99bd5..709a5c96 100644 --- a/docs/topics/2.4-accouncement.md +++ b/docs/topics/2.4-accouncement.md @@ -1,4 +1,111 @@ -* List/detail routes. -* 1.3 Support dropped, install six for <=1.4.?. +# REST framework 2.4 announcement + +The 2.4 release is largely an intermediate step, tying up some outstanding issues prior to the 3.x series. + +## Version requirements + +Support for Django 1.3 has been dropped. +The lowest supported version of Django is now 1.4.2. + +The current plan is for REST framework to remain in lockstep with [Django's long-term support policy][lts-releases]. + +## Django 1.7 support + +The optional authtoken application now includes support for *both* Django 1.7 schema migrations, *and* for old-style `south` migrations. + +**If you are using authtoken, and you want to continue using `south`, you must upgrade your `south` package to version 1.0.** + +## 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. + +To use it make sure you have first installed the test requirements. + + pip install -r requirements-test.txt + +Then run the `runtests.py` script. + + ./runtests.py + +The new test runner also includes [flake8](https://flake8.readthedocs.org) code linting, which should help keep our coding style consistent. + +#### Test runner flags + +Run using a more concise output style. + + ./runtests -q + +Run the tests using a more concise output style, no coverage, no flake8. + + ./runtests --fast + +Don't run the flake8 code linting. + + ./runtests --nolint + +Only run the flake8 code linting, don't run the tests. + + ./runtests --lintonly + +Run the tests for a given test case. + + ./runtests MyTestCase + +Run the tests for a given test method. + + ./runtests MyTestCase.test_this_method + +Shorter form to run the tests for a given test method. + + ./runtests test_this_method + +Note: The test case and test method matching is fuzzy and will sometimes run other tests that contain a partial string match to the given command line input. + +## Improved viewset routing + +The `@action` and `@link` decorators were inflexible in that they only allowed additional routes to be added against instance style URLs, not against list style URLs. + +The `@action` and `@link` decorators have now been moved to pending deprecation, and the `@list_route` and `@detail_route` decroators have been introduced. + +Here's an example of using the new decorators. Firstly we have a detail-type route named "set_password" that acts on a single instance, and takes a `pk` argument in the URL. Secondly we have a list-type route named "recent_users" that acts on a queryset, and does not take any arguments in the URL. + + class UserViewSet(viewsets.ModelViewSet): + """ + A viewset that provides the standard actions + """ + queryset = User.objects.all() + serializer_class = UserSerializer + + @detail_route(methods=['post']) + def set_password(self, request, pk=None): + user = self.get_object() + serializer = PasswordSerializer(data=request.DATA) + if serializer.is_valid(): + user.set_password(serializer.data['password']) + user.save() + return Response({'status': 'password set'}) + else: + return Response(serializer.errors, + status=status.HTTP_400_BAD_REQUEST) + + @list_route() + def recent_users(self, request): + recent_users = User.objects.all().order('-last_login') + page = self.paginate_queryset(recent_users) + serializer = self.get_pagination_serializer(page) + return Response(serializer.data) + +For more details, see the [viewsets](../api-guide/viewsets.md) documentation. + +## Other features + +## Deprecations + +## Labels and milestones + +TODO + * `allow_none` for char fields * `trailing_slash = True` --> `[^/]`, `trailing_slash = False` --> `[^/.]`, becomes simply `[^/]` and `lookup_value_regex` is added. + +[lts-releases]: https://docs.djangoproject.com/en/dev/internals/release-process/#long-term-support-lts-releases \ No newline at end of file diff --git a/docs/topics/release-notes.md b/docs/topics/release-notes.md index b0e5b198..a31be28f 100644 --- a/docs/topics/release-notes.md +++ b/docs/topics/release-notes.md @@ -38,26 +38,35 @@ You can determine your currently installed version using `pip freeze`: --- +## 2.4.x series + ### 2.4.0 -* Added compatibility with Django 1.7's native migrations. +**Django version requirements**: The lowest supported version of Django is now 1.4.2. - **IMPORTANT**: In order to continue to use South with Django <1.7 you **must** upgrade to - South v1.0. +**South version requirements**: This note applies to any users using the optional `authtoken` application, which includes an associated database migration. You must now *either* upgrade your `south` package to version 1.0, *or* instead use the built-in migration support available with Django 1.7. -* Use py.test +* Added compatibility with Django 1.7's database migration support. +* New test runner, using `py.test`. * `@detail_route` and `@list_route` decorators replace `@action` and `@link`. -* `six` no longer bundled. For Django <= 1.4.1, install `six` package. * 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. * Added `MAX_PAGINATE_BY` setting and `max_paginate_by` generic view attribute. * Added `cache` attribute to throttles to allow overriding of default cache. +* Added `lookup_value_regex` attribute to routers, to allow the URL argument matching to be constrainted by the user. +* Added `allow_none` option to `CharField`. +* Support Django's standard `status_code` class attribute on responses. +* More intuitive behavior on the test client, as `client.logout()` now also removes any credentials that have been set. * Bugfix: `?page_size=0` query parameter now falls back to default page size for view, instead of always turning pagination off. +* Bugfix: Always uppercase `X-Http-Method-Override` methods. +* Bugfix: Copy `filter_backends` list before returning it, in order to prevent view code from mutating the class attribute itself. +* Bugfix: Set the `.action` attribute on viewsets when introspected by `OPTIONS` for testing permissions on the view. +* Bugfix: Ensure `ValueError` raised during deserialization results in a error list rather than a single error. This is now consistent with other validation errors. +--- ## 2.3.x series - ### 2.3.14 **Date**: 12th June 2014 -- cgit v1.2.3 From 874d2be83c612fb5e04aa6a28901c2afe4bf9d3b Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 20 Aug 2014 00:19:03 +0100 Subject: Release notes --- docs/topics/2.4-accouncement.md | 48 +++++++++++++++++++++++++++++++++++------ 1 file changed, 42 insertions(+), 6 deletions(-) (limited to 'docs/topics') diff --git a/docs/topics/2.4-accouncement.md b/docs/topics/2.4-accouncement.md index 709a5c96..50484287 100644 --- a/docs/topics/2.4-accouncement.md +++ b/docs/topics/2.4-accouncement.md @@ -95,17 +95,53 @@ Here's an example of using the new decorators. Firstly we have a detail-type rou serializer = self.get_pagination_serializer(page) return Response(serializer.data) -For more details, see the [viewsets](../api-guide/viewsets.md) documentation. +For more details, see the [viewsets documentation](../api-guide/viewsets.md). ## Other features -## Deprecations +There are also a number of other features and bugfixes as [listed in the release notes][2-4-release-notes]. In particular these include: + +[Customizable view name and description functions][view-name-and-description-settings] for use with the browsable API, by using the `VIEW_NAME_FUNCTION` and `VIEW_DESCRIPTION_FUNCTION` settings. + +Smarter [client IP identification for throttling][client-ip-identification], with the addition of the `NUM_PROXIES` setting. + +## Deprecations + +All API changes in 2.3 that previously raised `PendingDeprecationWarning` will now raise a `DeprecationWarning`, which is loud by default. + +All API changes in 2.3 that previously raised `DeprecationWarning` have now been removed entirely. + +Furter details on these deprecations is available in the [2.3 announcement][2-3-announcement]. ## Labels and milestones -TODO +Although not strictly part of the 2.4 release it's also worth noting here that we've been working hard towards improving our triage process. + +The [labels that we use in GitHub][github-labels] have been cleaned up, and all existing tickets triaged. Any given ticket should have one and only one label, indicating its current state. + +We've also [started using milestones][github-milestones] in order to track tickets against particular releases. + +--- + +![Labels and milestones](../img/labels-and-milestones.png) + +**Above**: *Overview of our current use of labels and milestones in GitHub.* + +--- + +We hope both of these changes will help make the management process more clear and obvious and help keep tickets well-organised and relevant. + +## Next steps + +The next planned release will be 3.0, featuring an improved and simplified serializer implementation. -* `allow_none` for char fields -* `trailing_slash = True` --> `[^/]`, `trailing_slash = False` --> `[^/.]`, becomes simply `[^/]` and `lookup_value_regex` is added. +Once again, many thanks to all the generous [backers and sponsors][kickstarter-sponsors] who've helped make this possible! -[lts-releases]: https://docs.djangoproject.com/en/dev/internals/release-process/#long-term-support-lts-releases \ No newline at end of file +[lts-releases]: https://docs.djangoproject.com/en/dev/internals/release-process/#long-term-support-lts-releases +[2-4-release-notes]: ./topics/release-notes/#240 +[view-name-and-description-settings]: ../api-guide/settings/#view-names-and-descriptions +[client-ip-identification]: ../api-guide/throttling/#how-clients-are-identified +[2-3-announcement]: ./topics/2.3-announcement +[github-labels]: https://github.com/tomchristie/django-rest-framework/issues +[github-milestones]: https://github.com/tomchristie/django-rest-framework/milestones +[kickstarter-sponsors]: ./topics/kickstarter-announcement/#sponsors -- cgit v1.2.3