diff options
| author | Tom Christie | 2014-11-13 22:16:53 +0000 |
|---|---|---|
| committer | Tom Christie | 2014-11-13 22:16:53 +0000 |
| commit | cb672a0ecbc2b089370583884994dbd5f2b84acc (patch) | |
| tree | 31794263d2c052923e3258bed86955bedd7f161b | |
| parent | 992330055eeb5d787ddd7d62dfc9121a2256fd9b (diff) | |
| parent | 03310cc33ae800a36f17a421c8114e0e6616ccb6 (diff) | |
| download | django-rest-framework-cb672a0ecbc2b089370583884994dbd5f2b84acc.tar.bz2 | |
Merge branch 'master' of https://github.com/tomchristie/django-rest-framework
| -rw-r--r-- | README.md | 3 | ||||
| -rw-r--r-- | rest_framework/exceptions.py | 4 | ||||
| -rw-r--r-- | rest_framework/fields.py | 2 | ||||
| -rw-r--r-- | rest_framework/utils/html.py | 4 |
4 files changed, 8 insertions, 5 deletions
@@ -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 diff --git a/rest_framework/exceptions.py b/rest_framework/exceptions.py index 388d3dee..0b06d6e6 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): diff --git a/rest_framework/fields.py b/rest_framework/fields.py index 4933d8db..58482db5 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): diff --git a/rest_framework/utils/html.py b/rest_framework/utils/html.py index 15e83b3b..d773952d 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', } --> [ @@ -72,7 +72,7 @@ def parse_html_dict(dictionary, prefix): --> { 'profile': { - 'username': 'example, + 'username': 'example', 'email': 'example@example.com' } } |
