Commit Graph

8421 Commits

Author SHA1 Message Date
kuter
e9a54e38e1
add support for Yes/No literals with BooleanField (#7701) 2021-03-09 10:17:30 +00:00
Igor Polyakov
b463878132
Commas added in README (#7730)
To make it more comfortable for users to copy and paste snippets
2021-03-09 10:16:19 +00:00
Alex Cotsarelis
e32ebc4199
Docs: DjangoModelPermissions works on views with get_queryset() method. (#7693)
Sentinel querysets not needed after v3.1.2
2021-03-08 12:09:17 +00:00
Jean-Pierre Merx
234527959d
Have options example in documenting-your-api.md to return a Response (#7639)
It was returning data which is not correct. Closes #7638.

Co-authored-by: Jean-Pierre Merx <jean-pierre.merx@aictivate.com>
2021-03-08 12:08:26 +00:00
arcanemachine
ef112f5017
Provide example for dict in ValidationError detail (#7788)
Added a sentence describing the use of a dictionary as the `detail` argument of a ValidationError, and how it can be used to add field-level errors during object-level validation.
2021-03-08 11:46:35 +00:00
Tom Christie
ec29ff8a80
Delete ISSUE_TEMPLATE.md 2021-03-03 15:45:40 +00:00
Tom Christie
ee51145574
Update config.yml 2021-03-03 15:43:57 +00:00
Tom Christie
37b8d2018d
Create 1-issue.md 2021-03-03 15:42:38 +00:00
Tom Christie
db0bb5ef42
Update config.yml 2021-03-03 15:39:22 +00:00
Tom Christie
c9a00bdb2c
Update config.yml 2021-03-03 15:33:14 +00:00
Tom Christie
344235ab37
Create config.yml 2021-03-03 15:32:19 +00:00
Tom Christie
1deb8ae370
Update FUNDING.yml 2021-03-03 15:06:42 +00:00
Jonathan Mortensen
de7468d0b4
support multi db atomic_requests (#7739) 2021-03-03 11:15:39 +00:00
Usoof Mansoor
8f6d2d2f9c
Update docs link to Django OAuth Toolkit. (#7737) 2021-03-02 08:26:31 +01:00
Asif Saif Uddin
1ec0f86b58
Dj32 (#7713)
adds django 3.2 line to the build matrix
2021-02-16 13:17:29 +01:00
Tonye Jack
3e956df6eb Fixed test 2021-02-16 11:28:38 +01:00
Sebastian Jordan
19655edbf7
Handle tuples same as lists in ValidationError detail context (#7647) 2021-01-06 13:13:34 +00:00
Adrian Coveney
3db8877889 Clarify documentation for TemplateHTMLRenderer
Clarify that the response from a view may need to be modified to provide TemplateHTMLRenderer with a dict for it to use.
2020-12-30 09:11:38 +01:00
Tom Christie
8351747d98
Update index.md 2020-12-21 16:41:12 +00:00
Erwin Junge
bb133522ef Small documentation fix 2020-11-22 12:21:30 +01:00
babaroga
3ab8d4706e changed unicode to str 2020-11-21 18:25:55 +01:00
Karol Onyśko
96993d817a
Changed url to django docs so it points to the stable version (#7628)
Co-authored-by: Karol Onyśko <karol.onysko@cic.com>
2020-11-12 18:42:42 +01:00
Xavier Ordoquy
2b266897c9
Merge pull request #7634 from ge0rg/parser-docs
docs: outline the difference between JSON and form parsers. Fix #7633
2020-11-12 11:52:21 +01:00
Georg Lukas
6da94e5700 docs: outline the difference between JSON and form parsers. Fix #7633 2020-11-12 09:48:18 +01:00
Xavier Ordoquy
3578683a69
Merge pull request #7593 from encode/version-3.12.2
Version 3.12.2
2020-11-05 23:15:45 +01:00
bhealy-indeed
80444a0afb
nit: Typo fix (#7629) 2020-11-05 22:21:30 +01:00
Megan Gross
606df83885
Update throttling.md (#7606)
There were recent updates to the `@action` decorator calling a little more attention to the kwargs it accepts. 
I thought it would be useful to also provide an example in the throttling section of how those kwargs can be used to define/override throttle_classes through the action decorator as well.
2020-11-05 09:43:45 +01:00
James S Blachly, MD
56e4508123
Fix #7612 (#7622) 2020-11-02 09:45:43 +01:00
Jon Dufresne
9c29f5013f Use Python 3.9 release in Travis configuration 2020-11-01 20:36:08 +01:00
Xavier Ordoquy
47cfbdac97 Translations updated from transifex and compiled 2020-10-13 22:05:24 +02:00
Xavier Ordoquy
a0115e66d4 restore the transifex configuration
This reverts commit 6957aaae85.
2020-10-13 21:30:05 +02:00
David Smith
04e0c2b9ab
Bumped Markdown version to 3.3 (#7590) 2020-10-13 17:27:08 +01:00
Tom Christie
3799633cde Version 3.12.2 2020-10-13 14:17:53 +01:00
Pawel
95f0b0867a
Documentation: improve the action decorator documentation (#7316) (#7380)
* Documentation: improve the action decorator documentation (#7316)
2020-10-13 08:32:38 +02:00
Aarni Koskela
0bdd537cc4
Ignore derivations of BrowsableAPIRenderer in OpenAPI schema (#7497)
* Ignore derivations of BrowsableAPIRenderer in OpenAPI schema
* Improve test_renderer_mapping test

Co-authored-by: Carlton Gibson <carlton.gibson@noumenal.es>
2020-10-12 16:40:26 +02:00
Thomas Leese
eff97efa28
Don't catch exceptions in get_queryset (#7480)
In the `to_internal_value` method of the primary key and slug related fields, `TypeError`s and `ValueError`s are caught from `self.get_queryset().get(...)` and presented to the user. This works fine for most cases, but can cause problems if the exception is coming from `self.get_queryset()` rather than from the `.get(...)`.

It means errors in the `get_queryset` method can be hidden and presented back to the user as though, for example, the input provided to the `to_internal_value` was the wrong type, whereas in reality there's a bug in the `get_queryset` method and therefore it should bubble up and be exposed as a server error.

I've decided to fix this because twice now I've had to debug why I'm seeing `invalid_type` errors from my serializer (errors like `wrong pk type - int` when the `pk` type on my model is `int`) when the real problem was a bug in my custom `get_queryset` method.
2020-10-10 18:02:21 +01:00
Adam Johnson
fd5e1a745a
Fixed some documentation headings to use a space (#7364) 2020-10-10 17:42:59 +01:00
zach valenta
ffde169102
Add docs link to to_internal_value() (#7476) 2020-10-10 17:36:15 +01:00
Thomas Riccardi
1ef192811c
Add missing quoting for data keyword argument in serializer doc (#7587) 2020-10-10 17:34:39 +01:00
Adam Johnson
563b043768
Error on deprecation and pending deprecation warnings (#7586)
Erroring on deprecation or pending deprecation warnings means they are caught early. This will avoid the cycle of releasing with 'support for Django X', then chasing all the deprecation warnings one-by-one. Instead, when a new Django version is added to the test matrix, it will fail until all the relevant warnings are fixed. This avoids passing these warnings on to users, some of whom don't upgrade until they are all fixed.
2020-10-10 17:34:00 +01:00
David Smith
79c37d0dc3
Return NotImplemented sooner for ErrorDetail equality test (#7531)
The test suite raises warnings when tested against Python 3.9
`DeprecationWarning: NotImplemented should not be used in a boolean context`

Where `r` returns `NotImplemented` then this change returns `NotImplemented` first to avoid the comparison test.
2020-10-09 12:21:22 +01:00
Kryštof Pilnáček
79daf315c4
Fix: authtoken.TokenProxy cannot be proxy when not installed (#7571)
closes https://github.com/encode/django-rest-framework/issues/7442
2020-10-09 12:16:15 +01:00
Adam Johnson
931b34e7de
Remove tox-venv from Travis setup (#7585)
This was added in #6139. However it seems [tox-venv is no longer maintained](https://github.com/tox-dev/tox-venv), the related [virtualenv issue has been closed](https://github.com/pypa/virtualenv/issues/355), and I suspect with the virtualenv rewrite fixed the problem with site.py and the warnings referred to for the DRF tests.
2020-10-09 11:09:34 +01:00
Adam Johnson
7921e9af43
Fix RemovedInDjango40Warning for middleware get_resopnse() (#7513)
Fixes #7417.

Fixes all these issues seen with `tox -e py38-django31`:

```
  /Users/chainz/Documents/Projects/django-rest-framework/tests/test_request.py:208: RemovedInDjango40Warning: Passing None for the middleware get_response argument is deprecated.
    SessionMiddleware().process_request(self.wrapped_request)

tests/test_requests_client.py: 1 test with warning
tests/test_testing.py: 4 tests with warnings
tests/test_throttling.py: 1 test with warning
tests/authentication/test_authentication.py: 4 tests with warnings
tests/browsable_api/test_browsable_api.py: 4 tests with warnings
  /Users/chainz/Documents/Projects/django-rest-framework/rest_framework/authentication.py:139: RemovedInDjango40Warning: Passing None for the middleware get_response argument is deprecated.
    check = CSRFCheck()
```
2020-10-09 10:48:03 +01:00
Mopsan
5e23b559f8
Fix example override of SchemaGenerator.get_schema() 2020-10-09 09:38:11 +01:00
Xavier Ordoquy
2e721cdbc8
Merge pull request #7436 from markstory/patch-1
Fix broken links in documenting API section
2020-10-06 22:26:22 +02:00
Xavier Ordoquy
ebc1ebf0c4
Merge pull request #7481 from smithdc1/app-config
default_app_config application variable is deprecated in Django 3.2
2020-10-06 22:16:29 +02:00
Xavier Ordoquy
fdf277a782
Merge pull request #6843 from max-wittig/patch-1
docs(tutorial): add missing permission import in viewsets
2020-10-06 21:42:30 +02:00
स्पर्श
6a45a6a36f
Fix broken machinalis links (#7580)
#7572 #7423 #7573  all are related to this
2020-10-06 13:14:11 +01:00
Xavier Ordoquy
d635bc9c71
Merge pull request #7539 from verhovsky/patch-2
Correct indentation
2020-10-06 13:04:08 +02:00