django-rest-framework/rest_framework
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
..
authtoken Fix authtoken managment command (#5415) 2017-09-12 14:03:29 +01:00
locale Update compiled translations. 2017-08-21 12:05:25 +02:00
schemas Refactor schema generation to allow per-view customisation (#5354) 2017-09-14 09:46:34 +01:00
static/rest_framework Fix JS data binding 2017-08-17 12:33:59 +02:00
templates/rest_framework docs/link.html: fix/remove undefined template var "schema" 2017-08-21 14:47:43 +02:00
templatetags [NEW] Tests for templatetags.schema_links 2017-08-17 21:14:26 +02:00
utils Simplified chained comparisons and minor code fixes (#5276) 2017-07-16 17:12:29 +01:00
__init__.py Update version number 2017-08-21 12:06:14 +02:00
authentication.py RemoteUserAuthentication, docs, and tests (#5306) 2017-08-11 10:35:00 +01:00
compat.py Added pytz exception in compat module. 2017-03-22 00:03:32 -04:00
decorators.py Refactor schema generation to allow per-view customisation (#5354) 2017-09-14 09:46:34 +01:00
documentation.py Merge master. 2017-04-19 07:56:39 +02:00
exceptions.py Fix doc for ErrorDetail 2017-08-31 12:19:03 +02:00
fields.py Updated supported values for the NullBooleanField (#5387) 2017-09-04 10:11:53 +01:00
filters.py Fix SearchFilter to-many behavior by ANDing cond's 2017-07-10 14:50:47 -04:00
generics.py Add ValidationError to except in get_object_or_404 for django 1.11 2017-05-05 21:17:12 -04:00
metadata.py Don't list M2M choices in OPTIONS requests. Refs #3751. (#4160) 2016-06-01 17:28:32 +01:00
mixins.py Invalidate any existing prefetch cache on PUT requests. (#4668) 2016-11-11 09:44:35 +00:00
models.py Move models.resolve_model to serializers._resolve_model 2014-01-13 11:47:44 -05:00
negotiation.py Fixed various typos (#4366) 2016-08-08 09:32:22 +01:00
pagination.py Docs: update link in pagination.py (#5321) 2017-08-09 15:19:43 -04:00
parsers.py fixed to pass isort linting 2017-05-24 18:12:38 -07:00
permissions.py Unify QS handling for model/object permissions 2017-09-01 13:56:39 -04:00
relations.py 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
renderers.py Don't make the content mandatory in the generic content form (#5372) 2017-09-04 10:04:48 +01:00
request.py Force content_type inclusion in APIRequestFactory 2017-08-31 05:45:12 -04:00
response.py Drop unnecessary TODO notes. 2017-09-14 09:44:59 +01:00
reverse.py Version 3.5 (#4525) 2016-10-10 13:03:46 +01:00
routers.py Refactor schema generation to allow per-view customisation (#5354) 2017-09-14 09:46:34 +01:00
serializers.py Add failing test for named attribute 2017-09-04 15:44:04 +01:00
settings.py Fix parser names in docstring. 2017-03-29 07:57:14 +02:00
status.py Simplified chained comparisons and minor code fixes (#5276) 2017-07-16 17:12:29 +01:00
test.py Force content_type inclusion in APIRequestFactory 2017-08-31 05:45:12 -04:00
throttling.py Access request.user.is_authenticated as property not method, under Django 1.10+ (#4358) 2016-08-05 11:04:01 +01:00
urlpatterns.py Fixed Django 2.0 compatibility due to django.conf.urls.include parameters change. (#4866) 2017-01-30 16:11:19 +00:00
urls.py Add app_name to rest_framework.urls. 2015-12-08 02:25:00 +01:00
validators.py Update links after moving to encode org 2017-04-07 10:28:35 -04:00
versioning.py Remove extra parentheses (#4789) 2017-01-08 16:09:23 +00:00
views.py Refactor schema generation to allow per-view customisation (#5354) 2017-09-14 09:46:34 +01:00
viewsets.py Fixed #5228 Set ViewSet args/kwargs/request before dispatch 2017-06-22 16:22:17 +03:00