From 62ce653c61bb596f7fca99db86280c497c71b7ac Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Mon, 10 Nov 2014 14:44:26 +0000 Subject: [PATCH 1/5] Update fields.py --- rest_framework/fields.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 4933d8db6..58482db55 100644 --- a/rest_framework/fields.py +++ b/rest_framework/fields.py @@ -1106,7 +1106,7 @@ class HiddenField(Field): A hidden field does not take input from the user, or present any output, but it does populate a field in `validated_data`, based on its default value. This is particularly useful when we have a `unique_for_date` - constrain on a pair of fields, as we need some way to include the date in + constraint on a pair of fields, as we need some way to include the date in the validated data. """ def __init__(self, **kwargs): From 9521b697110f35187669e501c4fb89036c73c640 Mon Sep 17 00:00:00 2001 From: Kevin London Date: Mon, 10 Nov 2014 11:08:39 -0800 Subject: [PATCH 2/5] #2054: Update exceptions to allow custom detail This addresses the changes requested in #2054 and allows for custom messages that do not necessarily require a string formatter be present in the detail message. --- rest_framework/exceptions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 388d3dee9..0b06d6e60 100644 --- a/rest_framework/exceptions.py +++ b/rest_framework/exceptions.py @@ -70,7 +70,7 @@ class MethodNotAllowed(APIException): default_detail = "Method '%s' not allowed." def __init__(self, method, detail=None): - self.detail = (detail or self.default_detail) % method + self.detail = detail or (self.default_detail % method) class NotAcceptable(APIException): @@ -87,7 +87,7 @@ class UnsupportedMediaType(APIException): default_detail = "Unsupported media type '%s' in request." def __init__(self, media_type, detail=None): - self.detail = (detail or self.default_detail) % media_type + self.detail = detail or (self.default_detail % media_type) class Throttled(APIException): From 1838e18aeea1bfa5f033fb12adbd97e19231c8a1 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 12 Nov 2014 15:38:05 +0000 Subject: [PATCH 3/5] Update html.py --- rest_framework/utils/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/utils/html.py b/rest_framework/utils/html.py index 15e83b3b4..c7af22843 100644 --- a/rest_framework/utils/html.py +++ b/rest_framework/utils/html.py @@ -36,7 +36,7 @@ def parse_html_list(dictionary, prefix=''): '[0]foo': 'abc', '[0]bar': 'def', '[1]foo': 'hij', - '[2]bar': 'klm', + '[1]bar': 'klm', } --> [ From e70b82b6c890eed5088a8f1b2f3aa642d5218398 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Wed, 12 Nov 2014 15:38:39 +0000 Subject: [PATCH 4/5] Update html.py --- rest_framework/utils/html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rest_framework/utils/html.py b/rest_framework/utils/html.py index c7af22843..d773952dc 100644 --- a/rest_framework/utils/html.py +++ b/rest_framework/utils/html.py @@ -72,7 +72,7 @@ def parse_html_dict(dictionary, prefix): --> { 'profile': { - 'username': 'example, + 'username': 'example', 'email': 'example@example.com' } } From 03310cc33ae800a36f17a421c8114e0e6616ccb6 Mon Sep 17 00:00:00 2001 From: Tom Christie Date: Thu, 13 Nov 2014 12:06:45 +0000 Subject: [PATCH 5/5] Add PyPI version badge. --- README.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/README.md b/README.md index 394d7fcf4..c86bb65ff 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Django REST framework [![build-status-image]][travis] +[![pypi-version]][pypi] **Awesome web-browseable Web APIs.** @@ -181,6 +182,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. [build-status-image]: https://secure.travis-ci.org/tomchristie/django-rest-framework.png?branch=master [travis]: http://travis-ci.org/tomchristie/django-rest-framework?branch=master +[pypi-version]: https://pypip.in/version/djangorestframework/badge.svg +[pypi]: https://pypi.python.org/pypi/djangorestframework [twitter]: https://twitter.com/_tomchristie [group]: https://groups.google.com/forum/?fromgroups#!forum/django-rest-framework [0.4]: https://github.com/tomchristie/django-rest-framework/tree/0.4.X