Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
dbb435c
Added missing default style for FileField
kchang Nov 12, 2014
ad060aa
More helpful error message when default `.create` fails. Closes #2013.
gregmuellegger Nov 15, 2014
2f03483
Removed unused models
maryokhin Nov 29, 2014
dd9d40d
Moved non-conflicting models
maryokhin Nov 29, 2014
e2ea98e
Fixed typos
maryokhin Nov 29, 2014
bc0c25d
Consolidate Django and test requirements
jpadilla Dec 1, 2014
0a91999
Merge branch 'master' of github.com:tomchristie/django-rest-framework
maryokhin Dec 2, 2014
d847e33
Merge pull request #2161 from NextHub/master
lovelydinosaur Dec 2, 2014
deec61e
Merge pull request #2173 from jpadilla/master
lovelydinosaur Dec 2, 2014
f4fc467
Promote 'many_init' to public API. Closes #2152.
lovelydinosaur Dec 2, 2014
53f5276
Not allow to pass an empty actions to viewset.as_view(). Refs issue #…
BrickXu Dec 2, 2014
6ac79b8
Document Field.fail(). Closes #2147.
lovelydinosaur Dec 2, 2014
79e18a2
Raise assertion error if calling .save() on a serializer with errors.…
lovelydinosaur Dec 2, 2014
54b7b32
Merge branch 'fixes/2013' of git://github.com/gregmuellegger/django-r…
lovelydinosaur Dec 2, 2014
76ac641
Minor tweaks for helpful message on Model.objects.create() failure.
lovelydinosaur Dec 2, 2014
41045c1
Merge branch 'gregmuellegger-fixes/2013'
lovelydinosaur Dec 2, 2014
e30e3f6
Update README with 3.0 info.
lovelydinosaur Dec 2, 2014
0359e92
FileUploadParser. Raising StopFutureHandlers removes any handlers not…
lovelydinosaur Dec 2, 2014
84cff98
fix typo
daaray Dec 2, 2014
e335ad4
Merge pull request #2181 from daaray/patch-2
lovelydinosaur Dec 2, 2014
33096a1
BindingDict inherits from collections.MutableMapping. Closes #2135.
lovelydinosaur Dec 2, 2014
2123685
Merge branch 'master' of https://github.com/tomchristie/django-rest-f…
lovelydinosaur Dec 2, 2014
5ad22ae
Updated serializers documentation
cript0nauta Dec 2, 2014
95d57e6
Merge pull request #2182 from sh4r3m4n/master
lovelydinosaur Dec 2, 2014
9397a65
Use svg version of travis build status badge
eiriksm Dec 3, 2014
71a8cb2
Merge pull request #2185 from eiriksm/patch-1
lovelydinosaur Dec 3, 2014
c5a2d50
Merge pull request #2175 from BrickXu/fix_2171
lovelydinosaur Dec 3, 2014
74a9ece
Update build status icon on github pages page.
eiriksm Dec 3, 2014
5f2f54b
Merge pull request #2188 from eiriksm/patch-2
lovelydinosaur Dec 3, 2014
f2dd05a
Improved nested update test in update().
lovelydinosaur Dec 3, 2014
e1d98f7
Improve nested update and create testing.
lovelydinosaur Dec 3, 2014
ab25d70
Renamed validated_attrs to validated_data to be more in line with oth…
mtschammer Dec 3, 2014
66bce38
Merge pull request #2196 from tomchristie/tomchristie-improve-update-…
kevin-brown Dec 3, 2014
f221b73
Merge pull request #2197 from mtschammer/mtschammer-validated_attrs-r…
lovelydinosaur Dec 3, 2014
e8cbf41
Merge pull request #2172 from kchange/master
lovelydinosaur Dec 4, 2014
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fixed typos
  • Loading branch information
maryokhin committed Nov 29, 2014
commit e2ea98e8ab3192fa8d252d33cc03929fcf6ed02f
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[![build-status-image]][travis]
[![pypi-version]][pypi]

**Awesome web-browseable Web APIs.**
**Awesome web-browsable Web APIs.**

Full documentation for the project is available at [http://www.django-rest-framework.org][docs].

Expand All @@ -19,15 +19,15 @@ Django REST framework is a powerful and flexible toolkit for building Web APIs.

Some reasons you might want to use REST framework:

* The [Web browseable API][sandbox] is a huge useability win for your developers.
* The [Web browsable API][sandbox] is a huge usability win for your developers.
* [Authentication policies][authentication] including [OAuth1a][oauth1-section] and [OAuth2][oauth2-section] out of the box.
* [Serialization][serializers] that supports both [ORM][modelserializer-section] and [non-ORM][serializer-section] data sources.
* Customizable all the way down - just use [regular function-based views][functionview-section] if you don't need the [more][generic-views] [powerful][viewsets] [features][routers].
* [Extensive documentation][index], and [great community support][group].

There is a live example API for testing purposes, [available here][sandbox].

**Below**: *Screenshot from the browseable API*
**Below**: *Screenshot from the browsable API*

![Screenshot][image]

Expand Down Expand Up @@ -86,7 +86,7 @@ router.register(r'users', UserViewSet)


# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browseable API.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
Expand Down
4 changes: 2 additions & 2 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Django REST framework is a powerful and flexible toolkit that makes it easy to b

Some reasons you might want to use REST framework:

* The [Web browseable API][sandbox] is a huge usability win for your developers.
* The [Web browsable API][sandbox] is a huge usability win for your developers.
* [Authentication policies][authentication] including [OAuth1a][oauth1-section] and [OAuth2][oauth2-section] out of the box.
* [Serialization][serializers] that supports both [ORM][modelserializer-section] and [non-ORM][serializer-section] data sources.
* Customizable all the way down - just use [regular function-based views][functionview-section] if you don't need the [more][generic-views] [powerful][viewsets] [features][routers].
Expand Down Expand Up @@ -132,7 +132,7 @@ Here's our project's root `urls.py` module:
router.register(r'users', UserViewSet)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browseable API.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
Expand Down
6 changes: 3 additions & 3 deletions docs/topics/2.3-announcement.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ As an example of just how simple REST framework APIs can now be, here's an API w


# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browseable API.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
Expand Down Expand Up @@ -207,9 +207,9 @@ The old-style signature will continue to function but will raise a `PendingDepre

## View names and descriptions

The mechanics of how the names and descriptions used in the browseable API are generated has been modified and cleaned up somewhat.
The mechanics of how the names and descriptions used in the browsable API are generated has been modified and cleaned up somewhat.

If you've been customizing this behavior, for example perhaps to use `rst` markup for the browseable API, then you'll need to take a look at the implementation to see what updates you need to make.
If you've been customizing this behavior, for example perhaps to use `rst` markup for the browsable API, then you'll need to take a look at the implementation to see what updates you need to make.

Note that the relevant methods have always been private APIs, and the docstrings called them out as intended to be deprecated.

Expand Down
4 changes: 2 additions & 2 deletions docs/topics/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ You can determine your currently installed version using `pip freeze`:
* Add `UnicodeYAMLRenderer` that extends `YAMLRenderer` with unicode.
* Fix `parse_header` argument convertion.
* Fix mediatype detection under Python 3.
* Web browseable API now offers blank option on dropdown when the field is not required.
* Web browsable API now offers blank option on dropdown when the field is not required.
* `APIException` representation improved for logging purposes.
* Allow source="*" within nested serializers.
* Better support for custom oauth2 provider backends.
Expand Down Expand Up @@ -200,7 +200,7 @@ You can determine your currently installed version using `pip freeze`:
* Added `MAX_PAGINATE_BY` setting and `max_paginate_by` generic view attribute.
* Added `cache` attribute to throttles to allow overriding of default cache.
* 'Raw data' tab in browsable API now contains pre-populated data.
* 'Raw data' and 'HTML form' tab preference in browseable API now saved between page views.
* 'Raw data' and 'HTML form' tab preference in browsable API now saved between page views.
* Bugfix: `required=True` argument fixed for boolean serializer fields.
* Bugfix: `client.force_authenticate(None)` should also clear session info if it exists.
* Bugfix: Client sending empty string instead of file now clears `FileField`.
Expand Down
4 changes: 2 additions & 2 deletions docs/tutorial/6-viewsets-and-routers.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ Here's our re-wired `urls.py` file.
router.register(r'users', views.UserViewSet)

# The API URLs are now determined automatically by the router.
# Additionally, we include the login URLs for the browseable API.
# Additionally, we include the login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
Expand All @@ -130,7 +130,7 @@ That doesn't mean it's always the right approach to take. There's a similar set

## Reviewing our work

With an incredibly small amount of code, we've now got a complete pastebin Web API, which is fully web browseable, and comes complete with authentication, per-object permissions, and multiple renderer formats.
With an incredibly small amount of code, we've now got a complete pastebin Web API, which is fully web browsable, and comes complete with authentication, per-object permissions, and multiple renderer formats.

We've walked through each step of the design process, and seen how if we need to customize anything we can gradually work our way down to simply using regular Django views.

Expand Down
2 changes: 1 addition & 1 deletion docs/tutorial/quickstart.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Okay, now let's wire up the API URLs. On to `tutorial/urls.py`...
router.register(r'groups', views.GroupViewSet)

# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browseable API.
# Additionally, we include login URLs for the browsable API.
urlpatterns = [
url(r'^', include(router.urls)),
url(r'^api-auth/', include('rest_framework.urls', namespace='rest_framework'))
Expand Down
22 changes: 11 additions & 11 deletions tests/test_generics.py
Original file line number Diff line number Diff line change
Expand Up @@ -143,13 +143,13 @@ def test_post_cannot_set_id(self):
self.assertEqual(created.text, 'foobar')


EXPECTED_QUERYS_FOR_PUT = 3 if django.VERSION < (1, 6) else 2
EXPECTED_QUERIES_FOR_PUT = 3 if django.VERSION < (1, 6) else 2


class TestInstanceView(TestCase):
def setUp(self):
"""
Create 3 BasicModel intances.
Create 3 BasicModel instances.
"""
items = ['foo', 'bar', 'baz', 'filtered out']
for item in items:
Expand Down Expand Up @@ -189,7 +189,7 @@ def test_put_instance_view(self):
"""
data = {'text': 'foobar'}
request = factory.put('/1', data, format='json')
with self.assertNumQueries(EXPECTED_QUERYS_FOR_PUT):
with self.assertNumQueries(EXPECTED_QUERIES_FOR_PUT):
response = self.view(request, pk='1').render()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(dict(response.data), {'id': 1, 'text': 'foobar'})
Expand All @@ -203,7 +203,7 @@ def test_patch_instance_view(self):
data = {'text': 'foobar'}
request = factory.patch('/1', data, format='json')

with self.assertNumQueries(EXPECTED_QUERYS_FOR_PUT):
with self.assertNumQueries(EXPECTED_QUERIES_FOR_PUT):
response = self.view(request, pk=1).render()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, {'id': 1, 'text': 'foobar'})
Expand Down Expand Up @@ -238,7 +238,7 @@ def test_put_cannot_set_id(self):
"""
data = {'id': 999, 'text': 'foobar'}
request = factory.put('/1', data, format='json')
with self.assertNumQueries(EXPECTED_QUERYS_FOR_PUT):
with self.assertNumQueries(EXPECTED_QUERIES_FOR_PUT):
response = self.view(request, pk=1).render()
self.assertEqual(response.status_code, status.HTTP_200_OK)
self.assertEqual(response.data, {'id': 1, 'text': 'foobar'})
Expand Down Expand Up @@ -304,9 +304,10 @@ class TestOverriddenGetObject(TestCase):
Test cases for a RetrieveUpdateDestroyAPIView that does NOT use the
queryset/model mechanism but instead overrides get_object()
"""

def setUp(self):
"""
Create 3 BasicModel intances.
Create 3 BasicModel instances.
"""
items = ['foo', 'bar', 'baz']
for item in items:
Expand Down Expand Up @@ -379,11 +380,11 @@ class ClassB(models.Model):

class ClassA(models.Model):
name = models.CharField(max_length=255)
childs = models.ManyToManyField(ClassB, blank=True, null=True)
children = models.ManyToManyField(ClassB, blank=True, null=True)


class ClassASerializer(serializers.ModelSerializer):
childs = serializers.PrimaryKeyRelatedField(
children = serializers.PrimaryKeyRelatedField(
many=True, queryset=ClassB.objects.all()
)

Expand All @@ -396,8 +397,8 @@ class ExampleView(generics.ListCreateAPIView):
queryset = ClassA.objects.all()


class TestM2MBrowseableAPI(TestCase):
def test_m2m_in_browseable_api(self):
class TestM2MBrowsableAPI(TestCase):
def test_m2m_in_browsable_api(self):
"""
Test for particularly ugly regression with m2m in browsable API
"""
Expand Down Expand Up @@ -440,7 +441,6 @@ class Meta:


class TestFilterBackendAppliedToViews(TestCase):

def setUp(self):
"""
Create 3 BasicModel instances to filter on.
Expand Down