Skip to content

Commit 5abac93

Browse files
Merge branch 'master' into requests-client
2 parents 08c7853 + 964f825 commit 5abac93

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+792
-183
lines changed

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,7 @@ REST framework commercially we strongly encourage you to invest in its
1818
continued development by **[signing up for a paid plan][funding]**.
1919

2020
The initial aim is to provide a single full-time position on REST framework.
21-
Right now we're over 58% of the way towards achieving that.
22-
*Every single sign-up makes a significant impact.*
21+
*Every single sign-up makes a significant impact towards making that possible.*
2322

2423
<p align="center">
2524
<a href="http://jobs.rover.com/"><img src="https://raw.githubusercontent.com/tomchristie/django-rest-framework/master/docs/img/premium/rover-readme.png"/></a>

docs/api-guide/fields.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,9 @@ Defaults to `False`
4949

5050
### `default`
5151

52-
If set, this gives the default value that will be used for the field if no input value is supplied. If not set the default behavior is to not populate the attribute at all.
52+
If set, this gives the default value that will be used for the field if no input value is supplied. If not set the default behaviour is to not populate the attribute at all.
53+
54+
The `default` is not applied during partial update operations. In the partial update case only fields that are provided in the incoming data will have a validated value returned.
5355

5456
May be set to a function or other callable, in which case the value will be evaluated each time it is used. When called, it will receive no arguments. If the callable has a `set_context` method, that will be called each time before getting the value with the field instance as only argument. This works the same way as for [validators](validators.md#using-set_context).
5557

@@ -486,7 +488,7 @@ This field is used by default with `ModelSerializer` when including field names
486488

487489
**Signature**: `ReadOnlyField()`
488490

489-
For example, is `has_expired` was a property on the `Account` model, then the following serializer would automatically generate it as a `ReadOnlyField`:
491+
For example, if `has_expired` was a property on the `Account` model, then the following serializer would automatically generate it as a `ReadOnlyField`:
490492

491493
class AccountSerializer(serializers.ModelSerializer):
492494
class Meta:

docs/api-guide/filtering.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,6 @@ For more details on using filter sets see the [django-filter documentation][djan
241241
* By default filtering is not enabled. If you want to use `DjangoFilterBackend` remember to make sure it is installed by using the `'DEFAULT_FILTER_BACKENDS'` setting.
242242
* When using boolean fields, you should use the values `True` and `False` in the URL query parameters, rather than `0`, `1`, `true` or `false`. (The allowed boolean values are currently hardwired in Django's [NullBooleanSelect implementation][nullbooleanselect].)
243243
* `django-filter` supports filtering across relationships, using Django's double-underscore syntax.
244-
* For Django 1.3 support, make sure to install `django-filter` version 0.5.4, as later versions drop support for 1.3.
245244

246245
---
247246

docs/api-guide/permissions.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ This permission is suitable if you want to your API to allow read permissions to
132132

133133
## DjangoModelPermissions
134134

135-
This permission class ties into Django's standard `django.contrib.auth` [model permissions][contribauth]. This permission must only be applied to views that has a `.queryset` property set. Authorization will only be granted if the user *is authenticated* and has the *relevant model permissions* assigned.
135+
This permission class ties into Django's standard `django.contrib.auth` [model permissions][contribauth]. This permission must only be applied to views that have a `.queryset` property set. Authorization will only be granted if the user *is authenticated* and has the *relevant model permissions* assigned.
136136

137137
* `POST` requests require the user to have the `add` permission on the model.
138138
* `PUT` and `PATCH` requests require the user to have the `change` permission on the model.

docs/api-guide/throttling.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,8 @@ If the `.wait()` method is implemented and the request is throttled, then a `Ret
184184

185185
The following is an example of a rate throttle, that will randomly throttle 1 in every 10 requests.
186186

187+
import random
188+
187189
class RandomRateThrottle(throttling.BaseThrottle):
188190
def allow_request(self, request, view):
189191
return random.randint(1, 10) == 1

docs/api-guide/validators.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,8 @@ It takes a single required argument, and an optional `messages` argument:
6464

6565
This validator should be applied to *serializer fields*, like so:
6666

67+
from rest_framework.validators import UniqueValidator
68+
6769
slug = SlugField(
6870
max_length=100,
6971
validators=[UniqueValidator(queryset=BlogPost.objects.all())]
@@ -80,6 +82,8 @@ It has two required arguments, and a single optional `messages` argument:
8082

8183
The validator should be applied to *serializer classes*, like so:
8284

85+
from rest_framework.validators import UniqueTogetherValidator
86+
8387
class ExampleSerializer(serializers.Serializer):
8488
# ...
8589
class Meta:
@@ -114,6 +118,8 @@ These validators can be used to enforce the `unique_for_date`, `unique_for_month
114118

115119
The validator should be applied to *serializer classes*, like so:
116120

121+
from rest_framework.validators import UniqueForYearValidator
122+
117123
class ExampleSerializer(serializers.Serializer):
118124
# ...
119125
class Meta:
@@ -183,7 +189,7 @@ It takes a single argument, which is the default value or callable that should b
183189

184190
created_at = serializers.DateTimeField(
185191
read_only=True,
186-
default=CreateOnlyDefault(timezone.now)
192+
default=serializers.CreateOnlyDefault(timezone.now)
187193
)
188194

189195
---

docs/api-guide/versioning.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,8 @@ You can also set the versioning scheme on an individual view. Typically you won'
7171
The following settings keys are also used to control versioning:
7272

7373
* `DEFAULT_VERSION`. The value that should be used for `request.version` when no versioning information is present. Defaults to `None`.
74-
* `ALLOWED_VERSIONS`. If set, this value will restrict the set of versions that may be returned by the versioning scheme, and will raise an error if the provided version if not in this set. Note that the value used for the `DEFAULT_VERSION` setting is always considered to be part of the `ALLOWED_VERSIONS` set. Defaults to `None`.
75-
* `VERSION_PARAM`. The string that should used for any versioning parameters, such as in the media type or URL query parameters. Defaults to `'version'`.
74+
* `ALLOWED_VERSIONS`. If set, this value will restrict the set of versions that may be returned by the versioning scheme, and will raise an error if the provided version is not in this set. Note that the value used for the `DEFAULT_VERSION` setting is always considered to be part of the `ALLOWED_VERSIONS` set (unless it is `None`). Defaults to `None`.
75+
* `VERSION_PARAM`. The string that should be used for any versioning parameters, such as in the media type or URL query parameters. Defaults to `'version'`.
7676

7777
You can also set your versioning class plus those three values on a per-view or a per-viewset basis by defining your own versioning scheme and using the `default_version`, `allowed_versions` and `version_param` class variables. For example, if you want to use `URLPathVersioning`:
7878

docs/index.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,7 @@ REST framework commercially we strongly encourage you to invest in its
6868
continued development by **[signing up for a paid plan][funding]**.
6969

7070
The initial aim is to provide a single full-time position on REST framework.
71-
Right now we're over 58% of the way towards achieving that.
72-
*Every single sign-up makes a significant impact.*
71+
*Every single sign-up makes a significant impact towards making that possible.*
7372

7473
<ul class="premium-promo promo">
7574
<li><a href="http://jobs.rover.com/" style="background-image: url(https://fund-rest-framework.s3.amazonaws.com/rover_130x130.png)">Rover.com</a></li>
@@ -87,7 +86,7 @@ Right now we're over 58% of the way towards achieving that.
8786
REST framework requires the following:
8887

8988
* Python (2.7, 3.2, 3.3, 3.4, 3.5)
90-
* Django (1.7+, 1.8, 1.9)
89+
* Django (1.8, 1.9, 1.10)
9190

9291
The following packages are optional:
9392

docs/topics/release-notes.md

Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,49 @@ You can determine your currently installed version using `pip freeze`:
4040

4141
## 3.4.x series
4242

43+
### 3.4.4
44+
45+
**Date**: [12th August 2016][3.4.4-milestone]
46+
47+
* Ensure views are fully initialized when generating schemas. ([#4373][gh4373], [#4382][gh4382], [#4383][gh4383], [#4279][gh4279], [#4278][gh4278])
48+
* Add form field descriptions to schemas. ([#4387][gh4387])
49+
* Fix category generation for schema endpoints. ([#4391][gh4391], [#4394][gh4394], [#4390][gh4390], [#4386][gh4386], [#4376][gh4376], [#4329][gh4329])
50+
* Don't strip empty query params when paginating. ([#4392][gh4392], [#4393][gh4393], [#4260][gh4260])
51+
* Do not re-run query for empty results with LimitOffsetPagination. ([#4201][gh4201], [#4388][gh4388])
52+
* Stricter type validation for CharField. ([#4380][gh4380], [#3394][gh3394])
53+
* RelatedField.choices should preserve non-string values. ([#4111][gh4111], [#4379][gh4379], [#3365][gh3365])
54+
* Test case for rendering checkboxes in vertical form style. ([#4378][gh4378], [#3868][gh3868], [#3868][gh3868])
55+
* Show error traceback HTML in browsable API ([#4042][gh4042], [#4172][gh4172])
56+
* Fix handling of ALLOWED_VERSIONS and no DEFAULT_VERSION. [#4370][gh4370]
57+
* Allow `max_digits=None` on DecimalField. ([#4377][gh4377], [#4372][gh4372])
58+
* Limit queryset when rendering relational choices. ([#4375][gh4375], [#4122][gh4122], [#3329][gh3329], [#3330][gh3330], [#3877][gh3877])
59+
* Resolve form display with ChoiceField, MultipleChoiceField and non-string choices. ([#4374][gh4374], [#4119][gh4119], [#4121][gh4121], [#4137][gh4137], [#4120][gh4120])
60+
* Fix call to TemplateHTMLRenderer.resolve_context() fallback method. ([#4371][gh4371])
61+
62+
### 3.4.3
63+
64+
**Date**: [5th August 2016][3.4.3-milestone]
65+
66+
* Include fallaback for users of older TemplateHTMLRenderer internal API. ([#4361][gh4361])
67+
68+
### 3.4.2
69+
70+
**Date**: [5th August 2016][3.4.2-milestone]
71+
72+
* Include kwargs passed to 'as_view' when generating schemas. ([#4359][gh4359], [#4330][gh4330], [#4331][gh4331])
73+
* Access `request.user.is_authenticated` as property not method, under Django 1.10+ ([#4358][gh4358], [#4354][gh4354])
74+
* Filter HEAD out from schemas. ([#4357][gh4357])
75+
* extra_kwargs takes precedence over uniqueness kwargs. ([#4198][gh4198], [#4199][gh4199], [#4349][gh4349])
76+
* Correct descriptions when tabs are used in code indentation. ([#4345][gh4345], [#4347][gh4347])*
77+
* Change template context generation in TemplateHTMLRenderer. ([#4236][gh4236])
78+
* Serializer defaults should not be included in partial updates. ([#4346][gh4346], [#3565][gh3565])
79+
* Consistent behavior & descriptive error from FileUploadParser when filename not included. ([#4340][gh4340], [#3610][gh3610], [#4292][gh4292], [#4296][gh4296])
80+
* DecimalField quantizes incoming digitals. ([#4339][gh4339], [#4318][gh4318])
81+
* Handle non-string input for IP fields. ([#4335][gh4335], [#4336][gh4336], [#4338][gh4338])
82+
* Fix leading slash handling when Schema generation includes a root URL. ([#4332][gh4332])
83+
* Test cases for DictField with allow_null options. ([#4348][gh4348])
84+
* Update tests from Django 1.10 beta to Django 1.10. ([#4344][gh4344])
85+
4386
### 3.4.1
4487

4588
**Date**: [28th July 2016][3.4.1-milestone]
@@ -514,6 +557,9 @@ For older release notes, [please see the version 2.x documentation][old-release-
514557
[3.3.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.3.3+Release%22
515558
[3.4.0-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.0+Release%22
516559
[3.4.1-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.1+Release%22
560+
[3.4.2-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.2+Release%22
561+
[3.4.3-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.3+Release%22
562+
[3.4.4-milestone]: https://github.com/tomchristie/django-rest-framework/issues?q=milestone%3A%223.4.4+Release%22
517563

518564
<!-- 3.0.1 -->
519565
[gh2013]: https://github.com/tomchristie/django-rest-framework/issues/2013
@@ -943,3 +989,79 @@ For older release notes, [please see the version 2.x documentation][old-release-
943989
[gh4272]: https://github.com/tomchristie/django-rest-framework/issues/4272
944990
[gh4273]: https://github.com/tomchristie/django-rest-framework/issues/4273
945991
[gh4288]: https://github.com/tomchristie/django-rest-framework/issues/4288
992+
993+
<!-- 3.4.2 -->
994+
[gh3565]: https://github.com/tomchristie/django-rest-framework/issues/3565
995+
[gh3610]: https://github.com/tomchristie/django-rest-framework/issues/3610
996+
[gh4198]: https://github.com/tomchristie/django-rest-framework/issues/4198
997+
[gh4199]: https://github.com/tomchristie/django-rest-framework/issues/4199
998+
[gh4236]: https://github.com/tomchristie/django-rest-framework/issues/4236
999+
[gh4292]: https://github.com/tomchristie/django-rest-framework/issues/4292
1000+
[gh4296]: https://github.com/tomchristie/django-rest-framework/issues/4296
1001+
[gh4318]: https://github.com/tomchristie/django-rest-framework/issues/4318
1002+
[gh4330]: https://github.com/tomchristie/django-rest-framework/issues/4330
1003+
[gh4331]: https://github.com/tomchristie/django-rest-framework/issues/4331
1004+
[gh4332]: https://github.com/tomchristie/django-rest-framework/issues/4332
1005+
[gh4335]: https://github.com/tomchristie/django-rest-framework/issues/4335
1006+
[gh4336]: https://github.com/tomchristie/django-rest-framework/issues/4336
1007+
[gh4338]: https://github.com/tomchristie/django-rest-framework/issues/4338
1008+
[gh4339]: https://github.com/tomchristie/django-rest-framework/issues/4339
1009+
[gh4340]: https://github.com/tomchristie/django-rest-framework/issues/4340
1010+
[gh4344]: https://github.com/tomchristie/django-rest-framework/issues/4344
1011+
[gh4345]: https://github.com/tomchristie/django-rest-framework/issues/4345
1012+
[gh4346]: https://github.com/tomchristie/django-rest-framework/issues/4346
1013+
[gh4347]: https://github.com/tomchristie/django-rest-framework/issues/4347
1014+
[gh4348]: https://github.com/tomchristie/django-rest-framework/issues/4348
1015+
[gh4349]: https://github.com/tomchristie/django-rest-framework/issues/4349
1016+
[gh4354]: https://github.com/tomchristie/django-rest-framework/issues/4354
1017+
[gh4357]: https://github.com/tomchristie/django-rest-framework/issues/4357
1018+
[gh4358]: https://github.com/tomchristie/django-rest-framework/issues/4358
1019+
[gh4359]: https://github.com/tomchristie/django-rest-framework/issues/4359
1020+
1021+
<!-- 3.4.3 -->
1022+
[gh4361]: https://github.com/tomchristie/django-rest-framework/issues/4361
1023+
1024+
<!-- 3.4.4 -->
1025+
1026+
[gh2829]: https://github.com/tomchristie/django-rest-framework/issues/2829
1027+
[gh3329]: https://github.com/tomchristie/django-rest-framework/issues/3329
1028+
[gh3330]: https://github.com/tomchristie/django-rest-framework/issues/3330
1029+
[gh3365]: https://github.com/tomchristie/django-rest-framework/issues/3365
1030+
[gh3394]: https://github.com/tomchristie/django-rest-framework/issues/3394
1031+
[gh3868]: https://github.com/tomchristie/django-rest-framework/issues/3868
1032+
[gh3868]: https://github.com/tomchristie/django-rest-framework/issues/3868
1033+
[gh3877]: https://github.com/tomchristie/django-rest-framework/issues/3877
1034+
[gh4042]: https://github.com/tomchristie/django-rest-framework/issues/4042
1035+
[gh4111]: https://github.com/tomchristie/django-rest-framework/issues/4111
1036+
[gh4119]: https://github.com/tomchristie/django-rest-framework/issues/4119
1037+
[gh4120]: https://github.com/tomchristie/django-rest-framework/issues/4120
1038+
[gh4121]: https://github.com/tomchristie/django-rest-framework/issues/4121
1039+
[gh4122]: https://github.com/tomchristie/django-rest-framework/issues/4122
1040+
[gh4137]: https://github.com/tomchristie/django-rest-framework/issues/4137
1041+
[gh4172]: https://github.com/tomchristie/django-rest-framework/issues/4172
1042+
[gh4201]: https://github.com/tomchristie/django-rest-framework/issues/4201
1043+
[gh4260]: https://github.com/tomchristie/django-rest-framework/issues/4260
1044+
[gh4278]: https://github.com/tomchristie/django-rest-framework/issues/4278
1045+
[gh4279]: https://github.com/tomchristie/django-rest-framework/issues/4279
1046+
[gh4329]: https://github.com/tomchristie/django-rest-framework/issues/4329
1047+
[gh4370]: https://github.com/tomchristie/django-rest-framework/issues/4370
1048+
[gh4371]: https://github.com/tomchristie/django-rest-framework/issues/4371
1049+
[gh4372]: https://github.com/tomchristie/django-rest-framework/issues/4372
1050+
[gh4373]: https://github.com/tomchristie/django-rest-framework/issues/4373
1051+
[gh4374]: https://github.com/tomchristie/django-rest-framework/issues/4374
1052+
[gh4375]: https://github.com/tomchristie/django-rest-framework/issues/4375
1053+
[gh4376]: https://github.com/tomchristie/django-rest-framework/issues/4376
1054+
[gh4377]: https://github.com/tomchristie/django-rest-framework/issues/4377
1055+
[gh4378]: https://github.com/tomchristie/django-rest-framework/issues/4378
1056+
[gh4379]: https://github.com/tomchristie/django-rest-framework/issues/4379
1057+
[gh4380]: https://github.com/tomchristie/django-rest-framework/issues/4380
1058+
[gh4382]: https://github.com/tomchristie/django-rest-framework/issues/4382
1059+
[gh4383]: https://github.com/tomchristie/django-rest-framework/issues/4383
1060+
[gh4386]: https://github.com/tomchristie/django-rest-framework/issues/4386
1061+
[gh4387]: https://github.com/tomchristie/django-rest-framework/issues/4387
1062+
[gh4388]: https://github.com/tomchristie/django-rest-framework/issues/4388
1063+
[gh4390]: https://github.com/tomchristie/django-rest-framework/issues/4390
1064+
[gh4391]: https://github.com/tomchristie/django-rest-framework/issues/4391
1065+
[gh4392]: https://github.com/tomchristie/django-rest-framework/issues/4392
1066+
[gh4393]: https://github.com/tomchristie/django-rest-framework/issues/4393
1067+
[gh4394]: https://github.com/tomchristie/django-rest-framework/issues/4394

rest_framework/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"""
99

1010
__title__ = 'Django REST framework'
11-
__version__ = '3.4.1'
11+
__version__ = '3.4.4'
1212
__author__ = 'Tom Christie'
1313
__license__ = 'BSD 2-Clause'
1414
__copyright__ = 'Copyright 2011-2016 Tom Christie'

0 commit comments

Comments
 (0)