Skip to content

Merge upstream #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 127 commits into from
Dec 2, 2014
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
127 commits
Select commit Hold shift + click to select a range
311d315
Reverted 59d0a0387d907260ef8f91bbbca618831abd75a3 and fixed the tests
xordoquy Oct 8, 2014
6773568
Ensure `_resolve_model` does not return `None`
beck Nov 18, 2014
585054f
Streamlined tox config with 1.8 features
maryokhin Nov 25, 2014
1fcb495
Updated travis config
maryokhin Nov 25, 2014
b6de266
Added python 3.2 to test against django master . Related to #2075.
maryokhin Nov 25, 2014
9c58dfe
Fix shoddy test case
tomchristie Nov 25, 2014
fd980be
Documentation in 'many_init' docstring. Refs #2120.
tomchristie Nov 25, 2014
85f5e79
Merge pull request #2123 from NextHub/master
tomchristie Nov 25, 2014
c559ec6
Removed dots in Django versions in tox. Refs #2124.
maryokhin Nov 25, 2014
17c7431
Merge pull request #2126 from NextHub/master
tomchristie Nov 25, 2014
06fd63d
Don't use default_empty_html value for partial updates. Closes #2118.
tomchristie Nov 25, 2014
83e556b
Missing quotes on validate_score example
marctc Nov 25, 2014
2e726e2
request.DATA, request.FILES -> request.data
tomchristie Nov 25, 2014
b39bd7c
Merge pull request #2127 from marctc/patch-1
tomchristie Nov 25, 2014
a3c0c8f
Add missing period.
tomchristie Nov 25, 2014
c4dff54
Docs on ValidationError
tomchristie Nov 25, 2014
8328125
Hypenate 'un-coerced'
tomchristie Nov 25, 2014
3b40f8c
Drop 0.x release notes
tomchristie Nov 25, 2014
3a648b9
Migrate documentation to MkDocs proper
d0ugal Oct 9, 2014
b2762cb
Fixed typos in the config and updated Google analytics
d0ugal Oct 22, 2014
261c4ce
Remove redundant requirements file
d0ugal Oct 22, 2014
ae36a25
Add the kickstarter annoucement to the TOC
d0ugal Oct 22, 2014
04abe98
Add a docs build to the Tox run
d0ugal Oct 22, 2014
84d9c4b
Change site_dir to html to match mkdocs.py
d0ugal Oct 22, 2014
792c0c2
Remove the site ignore which isn't needed as we will use the html output
d0ugal Oct 23, 2014
2ddef2d
Drop simply from the mkdocs install lines
d0ugal Oct 23, 2014
d6b203f
Use page_title instead of title in docs theme
jpadilla Oct 28, 2014
18712a5
Fix the Navigation style
d0ugal Oct 29, 2014
49a493f
Bring back the promo section
d0ugal Oct 29, 2014
3c49b9f
Add next and previous page.
d0ugal Oct 29, 2014
5600878
Fixed the TOC (again)
d0ugal Oct 29, 2014
6da9d5a
Add a workaround for not having the index name
d0ugal Oct 29, 2014
b443f81
Add meta description
d0ugal Oct 29, 2014
5d479c2
Move nav to it's own template based on the MkDocs theme
d0ugal Oct 29, 2014
6a10b90
Correct the capitalisation of API
d0ugal Oct 29, 2014
d72a56f
Move the docs theme out of the docs folder.
d0ugal Oct 31, 2014
78223eb
Fixed copypasta fail
d0ugal Oct 31, 2014
cbb6799
Add validators from 27622058872c00e357deb7d7e86619a793ef4b41 and
d0ugal Nov 5, 2014
16d442d
Use MkDocs meta.source to render source code links
jpadilla Oct 31, 2014
3618273
Move content template into base.html
jpadilla Oct 31, 2014
3bfc820
Update tabbing and cleanup theme templates
jpadilla Oct 31, 2014
06683b8
Use single quotes for consistency
jpadilla Oct 31, 2014
200e0b1
Clean up extra white space
jpadilla Oct 31, 2014
b8aa7e0
Fix previous and next links
d0ugal Nov 18, 2014
8677316
Disable prev and next links
d0ugal Nov 18, 2014
6f28ade
Added nicer page titles
d0ugal Nov 19, 2014
df33538
Make the quotes consistent
d0ugal Nov 19, 2014
5a6bdd0
Highlight H1's in the TOC
d0ugal Nov 19, 2014
deb2bb4
Add Home link to the theme
d0ugal Nov 19, 2014
a0c12bf
Change the background of the selected page on the dropdown
d0ugal Nov 19, 2014
f2d4e51
Mark the homepage as active when visited
d0ugal Nov 19, 2014
aa1a844
Add The title to the top of the TOC for the home page
d0ugal Nov 25, 2014
935d94c
Don't add main to the top level items on the home page
d0ugal Nov 25, 2014
4d28a09
Refer to the current_page title rather than filename
d0ugal Nov 25, 2014
673f482
Remove commented out title
d0ugal Nov 25, 2014
66fc51d
Use the is_homepage property.
d0ugal Nov 25, 2014
e1b8412
Add markdown and PyYAML to tox test requirements
jpadilla Nov 25, 2014
38fe2c9
Document writing third party packages
jpadilla Nov 25, 2014
228c7e1
Merge pull request #2132 from jpadilla/third-party-packages
tomchristie Nov 25, 2014
64d8e3d
Typo. Refs #2132.
tomchristie Nov 25, 2014
653d626
Fix failing YAML tests
jpadilla Nov 25, 2014
eeb07ad
Merge pull request #2133 from jpadilla/tox
tomchristie Nov 25, 2014
8c91e7b
Add missing options
tomchristie Nov 25, 2014
d7f8047
Merge branch 'mkdocs' of git://github.com/d0ugal/django-rest-framewor…
tomchristie Nov 25, 2014
929135e
Include CNAME file
tomchristie Nov 25, 2014
84b34d4
Use default 'site' directory for docs builds
tomchristie Nov 25, 2014
306916a
Merge branch 'd0ugal-mkdocs'
tomchristie Nov 25, 2014
0ba94d7
Merge branch 'master' of https://github.com/tomchristie/django-rest-f…
tomchristie Nov 25, 2014
c7701cd
Tweak
tomchristie Nov 25, 2014
b733f85
Minor docs tweaks
tomchristie Nov 25, 2014
f13c0eb
Merge master
tomchristie Nov 25, 2014
4ed0ae8
Add validators page
tomchristie Nov 25, 2014
2647e1a
Move Quickstart back into 'Tutorial' section
tomchristie Nov 25, 2014
6c396a4
Merge branch 'master' into 3.0-docs
tomchristie Nov 25, 2014
3153656
Updating fields docs
tomchristie Nov 25, 2014
c01c631
perform_create, perform_update, perform_destroy hooks
tomchristie Nov 26, 2014
0f5338a
Call out removal of pre_save/post_save more strongly
tomchristie Nov 26, 2014
e1b14cb
3.0 docs for serializer fields
tomchristie Nov 26, 2014
678f7b4
Update notes on autocomplete
tomchristie Nov 26, 2014
b4550c6
Docstring for 'many_init'
tomchristie Nov 26, 2014
5a5a73c
3.0 docs and tidy-up for serializer relationships
tomchristie Nov 26, 2014
786cab7
Tweak to 3.0 relationship docs
tomchristie Nov 26, 2014
f5e5ed0
Merge remote-tracking branch 'reference/master' into bugfix/1850
xordoquy Nov 26, 2014
34bd2b7
a few typos
willstott101 Nov 26, 2014
d0e245b
grammar
willstott101 Nov 26, 2014
f203c75
Merge pull request #2141 from willstott101/once-one
tomchristie Nov 26, 2014
7674144
Be nicer with __closable_objects.
xordoquy Nov 26, 2014
9b88c09
Remove Third party packages section
jpadilla Nov 26, 2014
5155aa4
Merge pull request #2144 from jpadilla/patch-2
tomchristie Nov 27, 2014
0262262
3.0 serializer docs
tomchristie Nov 27, 2014
1ffe485
Support callable attributes in dotted source. Closes #2142.
tomchristie Nov 27, 2014
5a33adc
Merge branch 'master' of https://github.com/tomchristie/django-rest-f…
tomchristie Nov 27, 2014
2fe6709
Fix sponsor images for mkdocs
tomchristie Nov 27, 2014
fceeecf
Update to latest minor Django versions
jpadilla Nov 27, 2014
b73cc71
Merge pull request #2149 from jpadilla/master
tomchristie Nov 27, 2014
8579222
Fix for nested attribute lookups where one is a callable
tomchristie Nov 27, 2014
a88a37a
Merge branch 'master' of https://github.com/tomchristie/django-rest-f…
tomchristie Nov 27, 2014
6b2033f
Drop transform_<field_name>
tomchristie Nov 27, 2014
d2d7e1d
Drop Field.validate
tomchristie Nov 27, 2014
c61c59f
Notes on removal of Field.validate() and Serializer.transform_<field_…
tomchristie Nov 27, 2014
34ca8cd
Moar docs. Amazing.
tomchristie Nov 28, 2014
d4b8e35
Merge branch '3.0-docs'
tomchristie Nov 28, 2014
276a2a5
Docs on nested creates/updates and suchlike
tomchristie Nov 28, 2014
0539b1b
Update token auth view. Closes #2151.
maryokhin Nov 28, 2014
d9a09f7
Removed unused import
maryokhin Nov 28, 2014
05a86e3
Docs. Minor tweaks.
tomchristie Nov 28, 2014
9e03b08
Drop google_analytics config since it's in the base template anyways.
tomchristie Nov 28, 2014
d84582f
Add 'built with MkDocs' footer
tomchristie Nov 28, 2014
c8764de
Drop defunct tests
tomchristie Nov 28, 2014
66b3dae
Docs. Sponsor call-out.
tomchristie Nov 28, 2014
a741418
Merge pull request #2153 from maryokhin/patch-1
Nov 28, 2014
8e549a7
Add 2.x notes and links
tomchristie Nov 28, 2014
9ba29a8
Finalizing 3.0 release notes
tomchristie Nov 28, 2014
8d989bb
Merge pull request #2143 from linovia/bugfix/1850
tomchristie Nov 28, 2014
6fbd23a
Merge pull request #2086 from beck/doug/blow-up-with-bad-models
tomchristie Nov 28, 2014
3a5b377
Use ImproperlyConfigured when model meta lookup fails
tomchristie Nov 28, 2014
08c727a
@api_view defaults to allowing GET
tomchristie Nov 28, 2014
caf1de3
Minor tweaks to contributing docs
tomchristie Nov 28, 2014
72c4ec4
Add 3.0 announcement
tomchristie Dec 1, 2014
b9503cd
Support Django's core ValidationError for backwards compat. Refs #2145.
tomchristie Dec 1, 2014
22c5b86
More descriptive docstring on ModelSerializer
tomchristie Dec 1, 2014
270c7ac
Minor validtors tweak
tomchristie Dec 1, 2014
1caa14d
Minor 3.0 announcment tweaks
tomchristie Dec 1, 2014
555c450
Add missing 'validators.py' link. Closes #2166.
tomchristie Dec 1, 2014
080fa4f
Change allow_none to allow_null
jpadilla Dec 1, 2014
7b8699a
Merge pull request #2167 from jpadilla/patch-1
xordoquy Dec 1, 2014
d1fe61c
Fix requirements. Closes #2170.
tomchristie Dec 1, 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
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
*~
.*

html/
site/
htmlcov/
coverage/
build/
Expand Down
53 changes: 27 additions & 26 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,40 +1,41 @@
language: python

python: 2.7

sudo: false

env:
- TOX_ENV=flake8
- TOX_ENV=py3.4-django1.7
- TOX_ENV=py3.3-django1.7
- TOX_ENV=py3.2-django1.7
- TOX_ENV=py2.7-django1.7
- TOX_ENV=py3.4-django1.6
- TOX_ENV=py3.3-django1.6
- TOX_ENV=py3.2-django1.6
- TOX_ENV=py2.7-django1.6
- TOX_ENV=py2.6-django1.6
- TOX_ENV=py3.4-django1.5
- TOX_ENV=py3.3-django1.5
- TOX_ENV=py3.2-django1.5
- TOX_ENV=py2.7-django1.5
- TOX_ENV=py2.6-django1.5
- TOX_ENV=py2.7-django1.4
- TOX_ENV=py2.6-django1.4
- TOX_ENV=py3.4-djangomaster
- TOX_ENV=py3.3-djangomaster
- TOX_ENV=py2.7-djangomaster
- TOX_ENV=py27-flake8
- TOX_ENV=py27-docs
- TOX_ENV=py34-django17
- TOX_ENV=py33-django17
- TOX_ENV=py32-django17
- TOX_ENV=py27-django17
- TOX_ENV=py34-django16
- TOX_ENV=py33-django16
- TOX_ENV=py32-django16
- TOX_ENV=py27-django16
- TOX_ENV=py26-django16
- TOX_ENV=py34-django15
- TOX_ENV=py33-django15
- TOX_ENV=py32-django15
- TOX_ENV=py27-django15
- TOX_ENV=py26-django15
- TOX_ENV=py27-django14
- TOX_ENV=py26-django14
- TOX_ENV=py34-djangomaster
- TOX_ENV=py33-djangomaster
- TOX_ENV=py32-djangomaster
- TOX_ENV=py27-djangomaster

matrix:
fast_finish: true
allow_failures:
- env: TOX_ENV=py3.4-djangomaster
- env: TOX_ENV=py3.3-djangomaster
- env: TOX_ENV=py2.7-djangomaster
- env: TOX_ENV=py34-djangomaster
- env: TOX_ENV=py33-djangomaster
- env: TOX_ENV=py32-djangomaster
- env: TOX_ENV=py27-djangomaster

install:
- "pip install tox --download-cache $HOME/.pip-cache"
- pip install tox

script:
- tox -e $TOX_ENV
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,15 @@ There are many great markdown editors that make working with the documentation r

## Building the documentation

To build the documentation, simply run the `mkdocs.py` script.
To build the documentation, install MkDocs with `pip install mkdocs` and then run the following command.

./mkdocs.py
mkdocs build

This will build the html output into the `html` directory.

You can build the documentation and open a preview in a browser window by using the `-p` flag.
You can build the documentation and open a preview in a browser window by using the `serve` command.

./mkdocs.py -p
mkdocs serve

## Language style

Expand Down
1 change: 1 addition & 0 deletions docs/CNAME
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
www.django-rest-framework.org
2 changes: 1 addition & 1 deletion docs/api-guide/authentication.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a class="github" href="authentication.py"></a>
source: authentication.py

# Authentication

Expand Down
6 changes: 3 additions & 3 deletions docs/api-guide/content-negotiation.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a class="github" href="negotiation.py"></a>
source: negotiation.py

# Content negotiation

Expand Down Expand Up @@ -29,7 +29,7 @@ The priorities for each of the given media types would be:

If the requested view was only configured with renderers for `YAML` and `HTML`, then REST framework would select whichever renderer was listed first in the `renderer_classes` list or `DEFAULT_RENDERER_CLASSES` setting.

For more information on the `HTTP Accept` header, see [RFC 2616][accept-header]
For more information on the `HTTP Accept` header, see [RFC 2616][accept-header]

---

Expand Down Expand Up @@ -62,7 +62,7 @@ request when selecting the appropriate parser or renderer.
Select the first parser in the `.parser_classes` list.
"""
return parsers[0]

def select_renderer(self, request, renderers, format_suffix):
"""
Select the first renderer in the `.renderer_classes` list.
Expand Down
24 changes: 21 additions & 3 deletions docs/api-guide/exceptions.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<a class="github" href="exceptions.py"></a>
source: exceptions.py

# Exceptions

Expand Down Expand Up @@ -100,7 +100,7 @@ For example, if your API relies on a third party service that may sometimes be u

**Signature:** `ParseError(detail=None)`

Raised if the request contains malformed data when accessing `request.DATA` or `request.FILES`.
Raised if the request contains malformed data when accessing `request.data`.

By default this exception results in a response with the HTTP status code "400 Bad Request".

Expand Down Expand Up @@ -140,7 +140,7 @@ By default this exception results in a response with the HTTP status code "405 M

**Signature:** `UnsupportedMediaType(media_type, detail=None)`

Raised if there are no parsers that can handle the content type of the request data when accessing `request.DATA` or `request.FILES`.
Raised if there are no parsers that can handle the content type of the request data when accessing `request.data`.

By default this exception results in a response with the HTTP status code "415 Unsupported Media Type".

Expand All @@ -152,5 +152,23 @@ Raised when an incoming request fails the throttling checks.

By default this exception results in a response with the HTTP status code "429 Too Many Requests".

## ValidationError

**Signature:** `ValidationError(detail)`

The `ValidationError` exception is slightly different from the other `APIException` classes:

* The `detail` argument is mandatory, not optional.
* The `detail` argument may be a list or dictionary of error details, and may also be a nested data structure.
* By convention you should import the serializers module and use a fully qualified `ValidationError` style, in order to differentiate it from Django's built-in validation error. For example. `raise serializers.ValidationError('This field must be an integer value.')`

The `ValidationError` class should be used for serializer and field validation, and by validator classes. It is also raised when calling `serializer.is_valid` with the `raise_exception` keyword argument:

serializer.is_valid(raise_exception=True)

The generic views use the `raise_exception=True` flag, which means that you can override the style of validation error responses globally in your API. To do so, use a custom exception handler, as described above.

By default this exception results in a response with the HTTP status code "400 Bad Request".

[cite]: http://www.doughellmann.com/articles/how-tos/python-exception-handling/index.html
[authentication]: authentication.md
Loading