Commit Graph

3249 Commits

Author SHA1 Message Date
Jascha Geerds
161dc2df2c Call Django's authenticate function with the request object (#5295)
As of Django 1.11 the `authenticate` function accepts a request as an
additional argument. This commit fixes compatibility between newer Django
versions and custom authentication backends which already depend on the request
object.

See also:

[Django 1.11 release](https://docs.djangoproject.com/en/1.11/releases/1.11/)

```
authenticate() now passes a request argument to the authenticate() method of
authentication backends. Support for methods that don’t accept request as the
first positional argument will be removed in Django 2.1.
```
2017-10-05 10:43:49 +01:00
Carlton Gibson
d138f30a86 Fix naming collisions in Schema Generation (#5464)
* Add failing tests for #4704

* Add generic view based test case.

* Adjust insert_into to raise ValueError
2017-10-05 11:06:09 +02:00
Jerome Leclanche
cc7f4f543f Fix missing six.text_type() call on APIException.__str__ (#5476)
Pull up method from subclass to superclass

The call was added in 426547c61c
to allow for dict-style arguments to ValidationError but does not
apply to other APIException descendants.
2017-10-04 09:00:21 +02:00
Carlton Gibson
dc4a98fbe8 Fix documentation data rendering (#5472)
* Add failing test for #5395

* Add data filter for use in templates

Closes #5395

* Fix isort
2017-10-02 13:26:44 +02:00
Matteo Nastasi
063534ae50 Docstrings highlighting with pygments (#5462)
* add 'docstrings-with-pygments' feature without packages checks and tests

* move syntax_highlight doc filter in compatibility module and define it conditionally

* typo fixed

* add test for optional code highlight ('pygments' and 'markdown' packages must be installed)
2017-10-02 11:44:29 +02:00
Matteo Nastasi
efc427dfc8 Reuse 'apply_markdown' function in 'render_markdown' templatetag func (#5469)
* reused 'apply_markdown' function in 'render_markdown' templatetag function

* typo fixed
2017-10-02 08:59:53 +02:00
Ryan P Kilby
018e43e908 Remove old django-filter templates (#5465) 2017-09-29 15:42:24 +01:00
Thierry Bastian
760268ade2 Fixed a deprecation warning (#5058) 2017-09-27 10:51:45 +02:00
Carlton Gibson
b1c6ea1240 Adjust schema get_filter_fields rules to match framework (#5454)
Closes #5237

Generics/ModelViewset performs filtering on: list, retrieve, put, patch and destroy (plus method equivalents).

i.e. on list plus anything that calls `get_object`.

This PR makes schema generation follow that.

It adds `AutoSchema._allows_filters()` which can be overridden in subclasses.

I’ve made this initially “private” so we can make quick changes if needs be in a 3.7.1 etc.
2017-09-27 09:13:10 +02:00
Rokker Ruslan
ab7e5c4551 Added default value for 'detail' param into 'ValidationError' exception (#5342) 2017-09-26 10:24:30 +02:00
John Eskew
607e4edca7 Defer translated string evaluation on validators. (#5452)
* Customize validators to defer error string evaluation.

* Add docstring for `CustomValidatorMessage`
2017-09-26 10:02:20 +02:00
Ryan P Kilby
50acb9b2fe Fix warning in AutoSchema.get_serializer_fields() (#5451) 2017-09-25 21:09:54 +02:00
Sigve Sebastian Farstad
bf0fbd5df1 Catch APIException in doc generation (#5443)
The documentation generator calls view.get_serializer() in order to
inspect it for documentation generation. However, if get_serializer()
throws an APIException (e.g. PermissionDenied), it doesn't get caught at
the call site, but instead propagates up and aborts the entire view.
With the try/except in this commit, the documentation generator instead
gratiously ignores that particular view and moves on to the next one
instead. Practical concequences of this commit is that the docs no
longer break if any view's get_serializer(..) throws an APIException.
2017-09-25 18:28:36 +02:00
Katharyn Garcia
5333565fe6 allow custom authentication and permission classes for docs view 2017-09-25 16:17:25 +02:00
Matt Davis
107e8b3d23 Make DEFAULT_PAGINATION_CLASS None by default. (#5170)
* Changes to the paginator defaults and settings

Require a default paginator be specified when using the page size
setting.
https://github.com/encode/django-rest-framework/issues/5168

* DRF-5168 import warnings

missed this in last commit

* Add a system checks file

Add a check for pagination settings for the 3.7 upgrade cycle.

* more compatible import approach

* missing bactic

* revised language and approach to import the system check

Adds a rest framework app config.

* Adjust doc wording
2017-09-25 15:36:30 +02:00
Kris Dorosz
60b9e58a12 Add support for page_size parameter in CursorPaginator class 2017-09-25 11:25:51 +02:00
Carlton Gibson
e29ad1e7b3 JSONEncoder: Don’t strip microseconds from time
Closes #4749.

This is the matching commit to the fix for `datetime` in #4256
2017-09-25 10:10:44 +02:00
Ryan P Kilby
ea894cd90a Add docstring to json wrapper module 2017-09-25 09:08:20 +02:00
Ryan P Kilby
c98223f231 Pass on invalid value (Inf, NaN) encoding in JSONBoundField 2017-09-25 09:08:20 +02:00
Ryan P Kilby
901657e7e8 Add banned imports to prevent standard json import 2017-09-25 09:08:20 +02:00
Ryan P Kilby
8ab75a2f01 Add 'STRICT_JSON' API setting.
STRICT_JSON controls the renderer & parser behavior on whether or not
to accept non-standard float values (NaN, Infinity).
2017-09-25 09:08:20 +02:00
Ryan P Kilby
d740bae95a Update json imports 2017-09-25 09:08:20 +02:00
Ryan P Kilby
b64f8066c0 Add json util wrapper, failing JSONField test 2017-09-25 09:08:20 +02:00
Ryan P Kilby
f6c19e5eac Remove DjangoFilterBackend and associated tests 2017-09-20 16:47:54 +02:00
Carlton Gibson
7d6d043531 Fix DateTimeField TZ handling (#5435)
* Add failing TZ tests for DateTimeField

- tests "current" timezone activation
- tests output for non-UTC timezones

* Update DateTimeField TZ aware/naive test output

* Fix DateTimeField TZ handling

* Add Release Note for BC change
2017-09-20 12:15:15 +02:00
Jeremy Nauta
c0a48622e1 Allow ChoiceField.choices to be set dynamically (#5426)
## Description

The `choices` field for the `ChoiceField` class should be able to be edited after `ChoiceField.__init__` is called.

```
field = ChoiceField(choices=[1,2])
field.choices = [1]  # Should no longer allow `2` as a choice
```

Currently, you must update `choices`, `grouped_choices`, and `choice_strings_to_values` to achieve this. This P/R keeps `grouped_choices` and `choice_strings_to_values` in sync whenever the `choices` are edited.
2017-09-20 11:33:50 +02:00
Carlton Gibson
7b1582e00e Allow schema = None. Deprecate exclude_from_schema (#5422)
* Add tests for schema exclusions

* Move exclusion check to should_include_endpoint

* Update docs

* Switch to using `schema = None`

* Test PendingDeprecationWarnings

* Add note to release notes.

* s/deprecated/pending deprecation/

* Add PR link to release notes

* Correct typo in test class name

* Test 'exclude_from_schema' deprecation warning message (#1)

* Correct deprecation warning message
2017-09-20 11:29:47 +02:00
Carlton Gibson
efff9ff338 5378 fix schema generation markdown (#5421)
* Test case for #5240
* Remove unnecessary strip()  from get_description

Closes #5240

* Adjust test case
2017-09-14 12:20:41 +01:00
Carlton Gibson
d54df8c438 Refactor schema generation to allow per-view customisation (#5354)
* Initial Refactor Step

* Add descriptor class
* call from generator
* proxy back to generator for implementation.

* Move `get_link` to descriptor

* Move `get_description` to descriptor

* Remove need for generator in get_description

* Move get_path_fields to descriptor

* Move `get_serializer_fields` to descriptor

* Move `get_pagination_fields` to descriptor

* Move `get_filter_fields` to descriptor

* Move `get_encoding` to descriptor.

* Pass just `url` from SchemaGenerator to descriptor

* Make `view` a property

Encapsulates check for a view instance.

* Adjust API Reference docs

* Add `ManualSchema` class

* Refactor to `ViewInspector` plus `AutoSchema`

The interface then is **just** `get_link()`

* Add `manual_fields` kwarg to AutoSchema

* Add schema decorator for FBVs

* Adjust comments

* Docs: Provide full params in example

Ref feedback b52e372f8f (r137254795)

* Add docstring for ViewInstpector.__get__ descriptor method.

Ref https://github.com/encode/django-rest-framework/pull/5354#discussion_r137265022

* Make `schemas` a package.

* Split generators, inspectors, views.

* Adjust imports

* Rename to EndpointEnumerator

* Adjust ManualSchema to take `fields`

… and `description`.

Allows `url` and `action` to remain dynamic

* Add package/module docstrings
2017-09-14 09:46:34 +01:00
Tom Christie
5ea810d526 Drop unnecessary TODO notes. 2017-09-14 09:44:59 +01:00
Sergei Azarkin
9aaea2586b Fix authtoken managment command (#5415)
* Fix authtoken managment command username param
2017-09-12 14:03:29 +01:00
Carlton Gibson
71ad99e0b2 Merge pull request #5388 from founders4schools/fix/named-source
Fix ModelSerializer custom named fields with source on model
2017-09-04 17:24:36 +02:00
jhg14
3c1bf6bfd5 Add failing test for named attribute
Fix test crudely

Remove comment
2017-09-04 15:44:04 +01:00
Igor Tokarev
79be20a7c6 Updated supported values for the NullBooleanField (#5387)
* Updated supported values for the NullBooleanField.
* Added check for unhashable types in NullBooleanField.
2017-09-04 10:11:53 +01:00
Daniele Varrazzo
e42eb42d49 Don't make the content mandatory in the generic content form (#5372)
Sometimes, probably in the upgrade from Django 1.9 to 1.10, a post with
empty content is forbidden by javascript, with the message "Please fill
in this field". Filling the form with '{}' allows an application/json
request to be submitted.

The API call itself works perfectly well with a post with empty content:
the interface shouldn't make assumptions about it.
2017-09-04 10:04:48 +01:00
Carlton Gibson
7cd59147ea Merge pull request #5376 from rpkilby/django-perms-queryset
DjangoModelPermissions should perform auth check before accessing the view's queryset
2017-09-04 08:24:40 +02:00
Ryan P Kilby
23b2d8099b Unify QS handling for model/object permissions 2017-09-01 13:56:39 -04:00
Daniel Hahler
fff3db5517 Fix doc for ErrorDetail 2017-08-31 12:19:03 +02:00
Carlton Gibson
27c382c98d Merge pull request #5351 from rpkilby/requestfactory-contenttype
Unexpected result when passing empty body to RequestFactory
2017-08-31 12:13:49 +02:00
Ryan P Kilby
0ec915e623 Force content_type inclusion in APIRequestFactory 2017-08-31 05:45:12 -04:00
Ryan P Kilby
07258ca032 Remove None handling from fields.get_attribute() 2017-08-30 17:42:12 -04:00
Denis Untevskiy
c8773671e7 + Rejecting anonymous in DjangoModelPermissions *before* the .get_queryset call 2017-08-30 17:10:39 -04:00
Carlton Gibson
6a3b8cfa4c Adjust wording 2017-08-22 20:44:19 +02:00
Felipe Bidu
6f2c3bcb12 Further clarifying the message when get_queryset returns None to include the class name that was called 2017-08-22 12:13:22 -03:00
Felipe Bidu
5fd01d06ab Adding a more explicit error message when a view does have a get_queryset method but it returned nothing 2017-08-22 11:00:19 -03:00
Carlton Gibson
fed85bc29d Merge pull request #5344 from carltongibson/3.6.4-release
Release notes etc for 3.6.4
2017-08-22 08:55:38 +02:00
Daniel Hahler
e389336ad7 docs/link.html: fix/remove undefined template var "schema" 2017-08-21 14:47:43 +02:00
Carlton Gibson
1a7ed29639 Update version number 2017-08-21 12:06:14 +02:00
Carlton Gibson
d875fb3272 Update compiled translations. 2017-08-21 12:05:25 +02:00
Carlton Gibson
68d818fcc7 Update content from Transifex 2017-08-21 12:02:14 +02:00
Carlton Gibson
d2286ba658 Merge pull request #5326 from limdauto/limdauto-patch-1
Fix introspection of list field in schema
2017-08-21 10:09:57 +02:00
Carlton Gibson
4d5e846ca7 Merge pull request #5334 from Woile/woile-nested-docs-fix
Fix docs multiple nested and multiple methods
2017-08-18 11:05:06 +02:00
kycool
c868378c71 Update fields.py
modify to_choices_dict document
2017-08-18 12:12:01 +08:00
Woile
a1546cc266 [NEW] Tests for templatetags.schema_links 2017-08-17 21:14:26 +02:00
Woile
11bc1fe282 Fix JS data binding 2017-08-17 12:33:59 +02:00
Woile
ed38371c3a Fix docs multiple nested and multiple methods 2017-08-15 16:59:50 +02:00
Lim H
32a0b62508 Fix introspection of list field in schema 2017-08-12 18:59:03 +01:00
Alexander Dutton
e80b78d1cb RemoteUserAuthentication, docs, and tests (#5306)
RemoteUserAuthentication, docs, and tests
2017-08-11 10:35:00 +01:00
Yury V. Zaytsev
96d6a9a6da Docs: update link in pagination.py (#5321)
The blog post referenced in the documentation has been since moved to a new location.
2017-08-09 15:19:43 -04:00
Ryan P Kilby
26ebb88306 Revert 3288 (#5313)
* Add regression test for #2505. Thanks @pySilver!

* Add regression test for #5087

* Revert "Cached the field's root and context property."

This reverts commit 792005806b.
2017-08-07 16:52:09 +01:00
minusf
9ec89141ee typo: may -> many 2017-07-20 23:42:51 +02:00
Erick Delfin
089887d56e Simplified chained comparisons and minor code fixes (#5276) 2017-07-16 17:12:29 +01:00
Ryan P Kilby
d1cfec8d87 Fix SearchFilter to-many behavior by ANDing cond's 2017-07-10 14:50:47 -04:00
Tom Christie
6d4d4dfd04 Ensure closables in request.FILES get closed. (#5262)
Ensure closables on `.FILES` get closed.
2017-07-10 13:42:02 +01:00
elmccarthy
b905197f24 Fix issue #5258 (#5259)
Sanitize serializer.data to remove hidden fields before rendering template JSON instance to raw data form.

* Fix lint issues
2017-07-10 11:43:36 +01:00
Tom Christie
39f6f1137c Merge pull request #5261 from encode/validation-error-on-invalid-timezone-parsing
Raise validation error on invalid timezone parsing.
2017-07-10 11:27:28 +01:00
Tom Christie
fbb3490989 Merge pull request #5188 from andreagrandi/auth-token-cmd
Add Django manage command to create a DRF user Token
2017-07-10 10:35:05 +01:00
Tom Christie
c7e2bad524 Merge pull request #5189 from myrubapa/master
Fix API documentation templates do not check for user authentication #5162
2017-07-10 10:28:33 +01:00
Tom Christie
bf7fcc495b Raise validation error on invalid timezone parsing. 2017-07-10 10:14:31 +01:00
Tom Christie
3dab905656 Merge pull request #5231 from dmmatson/feature/slugfield-allow-unicode
Fixed tests on Windows. Added unicode support to SlugField
2017-07-07 12:41:52 +01:00
dmmatson
302a9d089e Fixed tests on Windows. Added unicode support to SlugField 2017-06-23 23:11:17 -06:00
Venelin Stoykov
0e5d26fa6a Fixed #5228 Set ViewSet args/kwargs/request before dispatch 2017-06-22 16:22:17 +03:00
José Padilla
9e72736af8 Merge pull request #5219 from blueyed/fix-doc-_authenticate
doc: fix documentation for Request._authenticate
2017-06-17 09:21:00 -04:00
Tom Christie
b069b0d33a Merge pull request #5176 from levic/browsable-api-multipart-form-data
Fix browsable API not supporting multipart/form-data correctly
2017-06-16 15:08:27 +01:00
Levi Cameron
5cbfcbc56f Fix regex typo allowing '[' in boundary string 2017-06-16 21:53:06 +10:00
Daniel Hahler
fe95ab675b doc: fix documentation for Request._authenticate
It does not return anything.
2017-06-16 13:23:26 +02:00
Tom Christie
598e5877cd Merge pull request #5192 from matteius/DRF-5135-one-to-one-pk
Special case for when OneToOneField is also primary key.
2017-06-16 12:06:12 +01:00
Dan Koch
4701f12c3e Quote nested API parameters in api.js
I sometimes have parameter names with a period (.) in them, to represent nested objects, e.g. containerobj.inner_param. The Javascript was throwing an error in the browsable API when interacting with those parameters.
2017-06-13 16:01:02 -04:00
Daniel Hahler
515fe928d5 Use stacklevel=2 with DeprecationWarnings
This makes the warnings refer to the code where it is used, which makes
it easier to find and fix.
2017-06-12 14:59:29 +02:00
Andrea Grandi
d2459710ca Implement option to reset User token 2017-06-03 11:58:01 +01:00
Andrea Grandi
34c38e0cfe Use self.sdtout and CommandError to print output 2017-06-03 11:06:14 +01:00
Andrea Grandi
cf196a4424 Get UserModel from get_user_model and do not infer the natural key 2017-06-03 10:38:01 +01:00
Pierre Sassoulas
903ef4917a Feat - Added aria-label and a new region for accessibility purpose
Navigating the page with a reader is easier is there is aria-label
and region.

https://www.w3.org/WAI/
2017-06-02 09:49:00 +02:00
Andrea Grandi
be590d61c0 Handle invalid User situation 2017-05-31 23:01:35 +01:00
Levi Cameron
6b8d6019ea Fix boundary detection regex not handling spaces inside boundary marker correctly 2017-05-31 13:18:17 +10:00
Matt Davis
6115815108 Special case for when OneToOneField is also primary key.
https://github.com/encode/django-rest-framework/issues/5135
2017-05-30 13:57:45 -04:00
Levi Cameron
1c44ef2b11 Improvements to code clarity 2017-05-30 10:43:33 +10:00
Bekhzod Tillakhanov
c96fa224c7 Fix ul inner li 2017-05-30 00:29:11 +05:00
Bekhzod Tillakhanov
84e22cc2f3 Scheme fix when unauth and Flask8 lint fix 2017-05-30 00:15:07 +05:00
Andrea Grandi
d198b1abe6 Add Django manage command to create a DRF user Token 2017-05-29 17:07:50 +01:00
Tom Christie
9c9525b130 Merge pull request #5187 from mathpresso-mom/list_route_regex
Fix list_route, detail_route with kwargs contains curly bracket in url_path
2017-05-29 13:47:19 +01:00
이동환
0ad017a573 requested changes 2017-05-29 20:55:06 +09:00
Tom Christie
823eea2d59 Merge pull request #5147 from imdark/patch-1
Improve memory footprint when reading large JSON requests.
2017-05-29 11:55:53 +01:00
Tom Christie
e2157fbf7c Merge pull request #5174 from tadhg-ohiggins/html_cutoff_none
Fix exception when HTML_CUTOFF is set to None
2017-05-29 11:54:03 +01:00
Dryice Liu
04adfb9c94 make sure max_length is in FileField kwargs 2017-05-28 04:14:56 +08:00
이동환
e6c9f89a12 Fixed curly bracket in regexp of @list_route 2017-05-25 19:13:45 +09:00
Levi Cameron
94c37c09c5 Fix browsable API not supporting multipart/form-data correctly
- Autodetect missing boundary parameter for Content-Type header
- textarea value normalises EOL chars to \n when multipart/form-data requires \r\n
2017-05-25 20:07:34 +10:00
imdark
cdeab1c490 fixed to pass isort linting 2017-05-24 18:12:38 -07:00
imdark
9a22811671 modified to use a reader
modified to use a reader since direct decoding is not supported
2017-05-24 17:56:49 -07:00
Tadhg O'Higgins
99782c2160 Add tests for HTML_CUTOFF setting and fix issue where setting it to None would raise an exception. 2017-05-24 16:46:18 -07:00
Matt Davis
99569190ab If pagination class, include the schema generation
https://github.com/encode/django-rest-framework/issues/5144
2017-05-22 19:10:54 -04:00
Thomas Achtemichuk
70205cc64e
Lint 2017-05-17 15:17:55 -04:00
Thomas Achtemichuk
c9c383dfad
Don't trim whitespace from authtoken passwords
* Fixes #5148
2017-05-17 14:52:39 -04:00
imdark
3a2ad8e68c in order to solve the memory leak at #5146
Large encoded string take a very long time to to release from memory, but if we just pass the stream directly into json.load we get much better memory performance.
2017-05-17 11:49:30 -07:00
Daniel Hahler
09f62e11a0 Possible fix 2017-05-16 12:07:04 +02:00
Vimarsh Chaturvedi
7b4afdc737 Merge branch 'master' into issue4989 2017-05-13 19:10:47 +05:30
vimarshc
b2d6149301 importing regex constant to remove invalid parameters. 2017-05-13 05:14:32 +05:30
Tom Christie
a99f12f1c6 Merge branch 'master' into version-3-6-3 2017-05-12 17:03:32 +01:00
Tom Christie
42f80c65a9 Version 3.6.3 2017-05-12 16:52:27 +01:00
Tom Christie
e8ff5e268b Javascript fixes for API docs 2017-05-12 16:48:53 +01:00
Nabil Jamaleddine
cdb8a3c3c8 Add ValidationError to except in get_object_or_404 for django 1.11 2017-05-05 21:17:12 -04:00
Tom Christie
69b0ac52c2 Merge pull request #5117 from rpkilby/fix-filter-backend
Fix DjangoFilterBackend mro
2017-05-04 12:32:03 +01:00
German Ilyin
5246a5a44e Fix a typo in a comment 2017-05-04 10:13:58 +06:00
Ryan P Kilby
01ffb8961d Fix DjangoFilterBackend mro 2017-05-03 12:51:44 -04:00
Tom Christie
97312699f5 Merge pull request #5085 from hurturk/schema-method-limited
Generate schema with respect to http_method_names provided by CBV
2017-05-03 09:16:01 +01:00
hurturk
518bb44a9e Remove excessive class instance while getting http_method_names 2017-05-03 03:49:04 -04:00
hurturk
6075f8051a Refactor CBV schema method limitation for set operations 2017-05-02 17:34:53 -04:00
Tom Christie
60dbe72a62 Merge pull request #4437 from dfavato/master
Set self.count before self.limit in LimitOffsetPagination
2017-05-02 10:21:36 +01:00
Tom Christie
dea601dc86 Merge pull request #4222 from NewVadim/master
Fix partial update for the ListSerializer.
2017-05-02 10:17:12 +01:00
Tom Christie
d2d0a06faf Merge pull request #5084 from Nerlin/fix-render-required-nested-serializer-error
Fixed render error of required nested serializer.
2017-05-02 10:05:25 +01:00
Tom Christie
80d0ee563a Merge pull request #5042 from boxingwizards/i4999
PoC Add JSONBoundField to serializers (Fixes #4999)
2017-04-27 20:26:40 +01:00
Tom Christie
5ba2368ff9 Merge pull request #4987 from halfstrik/master
Added test for DateTimeField validation when server has timezone with…
2017-04-27 17:22:27 +01:00
Tom Christie
aafd0a644f Merge pull request #4979 from linovia/feature/improve_schema_shortcut
Restrict doc & schema shortcuts to a subset of urls
2017-04-27 16:58:01 +01:00
Tom Christie
5e5fd67899 Merge pull request #5086 from valohai/limit-offset-pagination-schema
SchemaGenerator: Avoid crashing with pagesizeless paginators
2017-04-27 16:57:28 +01:00
Tom Christie
ee1a9fcef6 Merge pull request #5078 from rooterkyberian/issue-4748
add URL path unquote to HyperlinkedRelatedField.to_internal_value
2017-04-27 16:27:04 +01:00
Dave Allan
f56b117064 Pass non-JSON serializable values through unmodified 2017-04-26 14:10:47 -04:00
Dave Allan
7a0bd1c4d1 Use text area for JSON fields and indent JSON 2017-04-26 14:10:47 -04:00
Dave Allan
11d8e4df88 PoC Add JSONBoundField to serializers (Fixes #4999)
Per issue #4999, JSONFields are not rendered properly in the DRF
browsable API HTML forms.  This patch attempts to fix that behavior by
introducing a JSONBoundField helper similar to the NestedBoundField
helper.
2017-04-26 14:10:47 -04:00
Aarni Koskela
72da73310d SchemaGenerator: Avoid crashing with pagesizeless paginators 2017-04-19 09:43:28 +03:00
Xavier Ordoquy
778aee1bb3 Merge master. 2017-04-19 07:56:39 +02:00
hurturk
2196cd2bbb Generate schema with respect to http_method_names provided by CBV 2017-04-18 23:44:18 -04:00
nerlin
ed72603d35 Fixed render error of required nested serializer.
Fixes an error that occurs on rendering response with error that says that required nested serializer field must be specified in data.
2017-04-19 03:18:52 +03:00
Aarni Koskela
53f48d1564 Allow customizing DefaultRouter's schema generator class 2017-04-18 14:14:04 +03:00
Aarni Koskela
51a6c076e2 Allow customizing the SchemaGenerator class for docs 2017-04-18 14:14:04 +03:00
Maciej Urbanski
5e185aa26b add URL path unquote to HyperlinkedRelatedField.to_internal_value 2017-04-14 01:56:44 +02:00
Xavier Ordoquy
d757127e9a Merge remote-tracking branch 'reference/master' into feature/improve_schema_shortcut
* reference/master: (22 commits)
  Clarify get_schema_fields signature
  Updated monthly report link on funding page
  Bumped django-guardian version.
  remove django 1.11 from allow_failure matrix
  update django 1.11 to stable release in tox
  Update existing vary headers in response instead of overwriting them.
  Update links after moving to encode org
  Use overridden settings exception handler
  Pass initkwargs stored on view to instance
  Update 7-schemas-and-client-libraries.md
  Update Boolean field to more closely match python library
  Fix parser names in docstring.
  Fix typo at docstring
  update test case
  update test case
  fix unique=True validation for ChoiceField
  Added drfpasswordless to Authentication docs
  Document adding django_filters to installed apps
  Added drfpasswordless to third party packages topic page.
  Added drfpasswordless to authentication topic page.
  ...
2017-04-13 08:29:47 +02:00
Tom Christie
d300c3c648 Merge pull request #5047 from kirberich/merge-vary-headers
Update existing vary headers in response instead of overwriting them.
2017-04-07 20:44:58 +01:00
Tom Christie
33290170e8 Merge pull request #5060 from jpadilla/encode
Update links after moving to encode org
2017-04-07 17:20:51 +01:00
Robert Kirberich
9ebd5a29e4 Update existing vary headers in response instead of overwriting them.
Previously, any existing vary headers would simply be wiped out by DRF. Using patch_vary_headers assures that existing headers remain.
2017-04-07 17:06:09 +01:00
José Padilla
c1f31492ae
Update links after moving to encode org 2017-04-07 10:28:35 -04:00
Tom Christie
bbe0df2916 Merge pull request #5053 from s-m-b/patch-1
Pass initkwargs stored on view to instance
2017-04-07 08:29:34 +01:00
Ian Cordasco
c2ee1b3033 Use overridden settings exception handler
Instead of using the api_settings exception handler, we use the
overridden settings attribute to find the correct handler.

Closes #5054
2017-04-06 14:05:29 -05:00
s-m-b
f1ca71ce21 Pass initkwargs stored on view to instance 2017-04-06 16:38:28 +04:00
htmis
4a54d9f474 Update Boolean field to more closely match python library
Python Reference:
distutils.util.strtobool(val)
Convert a string representation of truth to true (1) or false (0).
True values are y, yes, t, true, on and 1; false values are n, no, f, false, off and 0. Raises ValueError if val is anything else.
2017-03-29 20:21:18 -04:00
Xavier Ordoquy
d417c6d1b9 Fix parser names in docstring. 2017-03-29 07:57:14 +02:00
Ilya Beda
f27c551218 Fix typo at docstring 2017-03-29 12:51:01 +07:00
Ekluv
56fe0e4b3f fix unique=True validation for ChoiceField 2017-03-28 00:38:21 +05:30
Xavier Ordoquy
6ad0be44d3 Merge remote-tracking branch 'reference/master' into feature/improve_schema_shortcut
* reference/master:
  use django 1.11rc1 in tox
  Leave parameters with regex pattern as String
  restored original formatting
  Do not hint BigAutoField as integer (outside of range)
  Mention where the mixins live
  Try to improve browser support
  Cleanup and refactor docs api.js script
  Move bootstrap modal data attrs to anchor
  Remove unused base.js script
  Correctly set scheme in coreapi TokenAuthentication
  reverted to fix the issue without changing setting
  DEFAULT_PAGINATION_CLASS is changed to 'None'
  add content block and breadcrumbs_empty block to allow base.html to be reused
  Update 7-schemas-and-client-libraries.md
  Updated testimonial name on funding site
  ID must start from 1 again
2017-03-24 15:21:43 +01:00
Tom Christie
0fdaf4f481 Merge pull request #5001 from jpadilla/docs-cleanup
JavaScript cleanup in API Docs.
2017-03-22 14:01:00 +00:00
Tom Christie
8e9cb1e614 Merge pull request #5014 from dczech/feature/decouple-bigautofield
Include URL path regexs in API schemas where valid.
2017-03-22 09:37:07 +00:00