Commit Graph

8181 Commits

Author SHA1 Message Date
Sebastian Pipping
373e521f36 Make CharField prohibit surrogate characters (#7026) (#7067)
* CharField: Detect and prohibit surrogate characters

* CharField: Cover handling of surrogate characters
2020-01-06 14:12:21 +00:00
Alex ⚡
165da5be0c Documentation: make codeblocks easier to read. (#6896) 2020-01-03 14:42:29 +00:00
phankiewicz
a9e55334e7 Add X-CSRFToken HTTP header in swagger-ui example (#6968) 2020-01-03 13:59:32 +00:00
Frederico Lima
25ac7ba450 Add third party lib drf-viewset-profiler (#6993) 2020-01-03 13:53:09 +00:00
Tom Christie
430a567258
Update openapi.py 2020-01-03 13:50:26 +00:00
Noam
ced37a56cb Avoid outputting callable defaults to schema. (#7105) 2020-01-03 13:49:46 +00:00
Bart
07376f128c Grammar fix (#6933) 2020-01-03 13:36:43 +00:00
Jihoon Park
f3ed69374d Add missing punctuation marks and URL name (#7108)
- trailing commas (as both Python and JavaScript allow them)
- trailing semicolons in JavaScript
- URL name `api-docs`
2020-01-03 13:28:35 +00:00
Ran Benita
62ae241894 Remove outdated comment in SerializerMethodField (#7110)
Since 91ea138406.
2020-01-02 14:52:05 +00:00
Ran Benita
d985c7cbb9 Remove a few no longer needed compat checks and references (#7092)
* serializers: removes no longer needed compat checks

UUIDField and DurationField are both supported in all supported Django
versions.

IPAddressField was removed in Django 1.9, which is no longer supported.

* serializers: move related code closer together

This way it's easier to see all of the mappings in one place.

* serializers,docs: remove some DRF 2.x references

The last release of DRF 2.x was 5 years ago, it seems fine to remove
these references now.
2019-12-16 18:59:25 +00:00
Tom Christie
de497a9bf1
Version 3.11 (#7083)
* Version 3.11

* Added notes on OpenAPI changes for 3.11.

* Minor docs tweaking

* Update package version and supported versions

* Use a lazy import for django.test.client.encode_mutlipart. Closes #7078
2019-12-12 14:31:40 +00:00
Jordan Ephron
3c1428ff79 Fix NotImplementedError for Field.to_internal_value and Field.to_representation (#6996) 2019-12-12 14:09:34 +00:00
Ryan P Kilby
b8c369c4cf Fix serializer multiple inheritance bug (#6980)
* Expand declared filtering tests

- Test declared filter ordering
- Test multiple inheritance

* Fix serializer multiple inheritance bug

* Improve field order test to check for field types
2019-12-12 14:03:55 +00:00
Adam Johnson
7c5459626d Declare Django versions in install_requires (#7063)
* Declare Django versions in install_requires

Pip's dependency resolver (used in pipenv, pip-compile, poetry, etc.) can use this to infer whether there's a verison collision in what it's being asked to install or not.

* No max
2019-12-12 13:03:34 +00:00
Ryan P Kilby
236667b717 Fix UniqueTogetherValidator with field sources (#7086)
* Add failing tests for unique_together+source

* Fix UniqueTogetherValidator source handling

* Fix read-only+default+source handling

* Update test to use functional serializer

* Test UniqueTogetherValidator error+source
2019-12-12 13:02:30 +00:00
Aarni Koskela
f744da74d2 Improve the docstring on @action (#6951) 2019-12-11 15:08:54 -08:00
Ryan P Kilby
de9f1d56c4 Followup to set_context removal (#7076)
* Raise framework-specific deprecation warnings

- Use `RemovedInDRF313Warning` instead of DeprecationWarning
- Update to follow deprecation policy

* Pass serializer instead of model to validator

The `UniqueTogetherValidator` may need to access attributes on the
serializer instead of just the model instance. For example, this is
useful for handling field sources.

* Fix framework deprecation warning in test

* Remove outdated validator attribute
2019-12-11 08:44:08 +00:00
Roy Segall
ebcd93163a Adding I'm a teapot error code (#7081) 2019-12-10 09:18:35 +00:00
Ryan P Kilby
90eaf51839
Update framework deprecation warnings (#7075)
- Bump version numbers for deprecation warnings
- Drop deprecated features
2019-12-04 16:18:38 -08:00
Ryan P Kilby
95d4843abe
Fix Django 3.0 deprecations (#7074) 2019-12-04 14:14:43 -08:00
Hasan Ramezani
4d9f9eb192 Changed default widget for TextField with choices to select (#6892) 2019-12-04 12:24:49 -08:00
Kye Russell
dff9759555 Removed Eric S. Raymond quote from the release notes (#7073) 2019-12-04 09:29:01 +00:00
Tom Christie
070cff5a03
Drop set_context() (#7062)
* Do not persist the context in validators

Fixes encode/django-rest-framework#5760

* Drop set_context() in favour of 'requires_context = True'
2019-12-03 11:16:27 +00:00
Asif Saif Uddin
9325c3f654 dj 3.0 (#7070) 2019-12-03 11:13:44 +00:00
Oskar Persson
8001087e9e Fix typo in unsupported version error message (#7060) 2019-11-21 14:59:50 +00:00
Tom Christie
7fbbfe2c60
Django 3 compat (#7058)
* First pass at Django 3.0 compat

* Drop Guardian for 1.11 tests, since we're installing an incompatible version

* Fix ROOT_URLCONF override in test case

* Fix typo

Co-Authored-By: Rémy HUBSCHER <hubscher.remy@gmail.com>

* Linting
2019-11-21 11:55:53 +00:00
Tom Christie
fe840a34ff
Escape hyperlink URLs on lookup (#7059)
* Escape hyperlink URLs on lookup

* Rename duplicate test
2019-11-21 11:38:40 +00:00
Xavier Ordoquy
39876e6607
Merge pull request #7061 from b0uh/doc-remove-old-ref
[Doc] Remove the old reference to `JSONResponse`
2019-11-20 14:29:04 +01:00
Thomas Loiret
adaf97a739 Remove the old reference to JSONResponse 2019-11-20 14:09:49 +01:00
Hendrik
a73d3c309f Elaborated on nested relationships (#7051) 2019-11-18 12:35:36 +00:00
CloudCode Hungary
6196e9c8cd add djangorestframework-features to third-party (#7052) 2019-11-18 12:31:32 +00:00
Chris Guo
cad1b08260 Fix override func style and regular usage (#7050)
* style: add space and rm redundant parentheses

* refactor: use super to replace inherit class

* Prefer explicit tuple syntax
2019-11-18 12:30:36 +00:00
James
323e1cddda Cleanup "Documenting your API" 3rd party recommendations (#7057) 2019-11-15 18:39:47 -08:00
Maxime Jacques
8988afa082 Update bootstrap to 3.4.1 (#6923) 2019-11-11 16:41:10 -05:00
brantmorton
0d6589cf45 Updated url() with re_path() in Versioning docs. (#7043) 2019-11-07 13:20:56 +01:00
Yann Savary
0d3d548aa5 OpenAPI: Fixed generation when title or version not provided. (#6912) 2019-11-06 21:54:12 +01:00
Yann Savary
7c3477dcda OpenAPI: Ported docstring operation description from CoreAPI inspector. (#6898) 2019-11-06 21:52:02 +01:00
Kentalot
becb962160 OpenAPI: Use int64 format for large integers. (#7018) 2019-11-06 21:46:19 +01:00
Dima Knivets
8b06ce72d7 OpenAPI: Map renderers/parsers for request/response media-types. (#6865) 2019-11-06 21:44:51 +01:00
Aaron Yong
14d740d088 Update DEFAULT_SCHEMA_CLASSES default value in Settings docs (#7014)
The default value was changed to point to the OpenAPI AutoSchema class.  The docs were leading users to believe that rest_framework.schemas.AutoSchema was the default.  As of this commit, the root AutoSchema is in fact imported from the coreapi module.
2019-11-06 21:37:13 +01:00
Erwan Rouchet
5e8fe6edf0 Fix link to Django docs (#7040) 2019-11-06 09:34:28 -08:00
Tom Christie
82f2569895
Update __init__.py 2019-11-05 16:43:32 +00:00
Chris Guo
5521eacb02 Update docs imports (#7030) 2019-11-01 10:56:59 -07:00
Daniel Hnyk
ab40b80fa6 Remove unmaintained django-rest-framework-bulk from docs (#7021) 2019-10-28 03:46:44 -07:00
Erwan Rouchet
39bd6cc5cb Set the proper JSON schema type for HStoreFields in OpenAPI schemas (#6914) 2019-10-27 21:13:01 -04:00
Chris Guo
5ee970c090 Fix docs typos (#7015) 2019-10-24 11:31:12 -07:00
Jeremy Lainé
c9f06bf73f Fix a spelling error in openapi AutoSchema method (#7004)
Replace "pagninator" by "paginator".
2019-10-24 10:51:16 +02:00
Aaron Yong
4d57cd31f6 Update method override example in Schemas docs (#6887) (#7013)
get_link() was a method in the old CoreAPI-based AutoSchema implementation.  The new OpenAPI one defines get_operation() instead: the example code block was overlooked.
2019-10-24 08:54:37 +02:00
Bastien Vallet
64f567a021 Bump CI to Python 3.8 (#7008) 2019-10-22 14:39:01 -07:00
Ryan P Kilby
a8c86be660
Update linter requirements (#7010) 2019-10-22 11:18:51 -07:00