django-rest-framework/rest_framework/utils
Ryan P Kilby 0148a9f8da Improvements to ViewSet extra actions (#5605)
* View suffix already set by initializer

* Add 'name' and 'description' attributes to ViewSet

ViewSets may now provide their `name` and `description` attributes
directly, instead of relying on view introspection to derive them.
These attributes may also be provided with the view's initkwargs.

The ViewSet `name` and `suffix` initkwargs are mutually exclusive.

The `action` decorator now provides the `name` and `description` to
the view's initkwargs. By default, these values are derived from the
method name and its docstring. The `name` may be overridden by providing
it as an argument to the decorator.

The `get_view_name` and `get_view_description` hooks now provide the
view instance to the handler, instead of the view class. The default
implementations of these handlers now respect the `name`/`description`.

* Add 'extra actions' to ViewSet & browsable APIs

* Update simple router tests

Removed old test logic around link/action decorators from `v2.3`. Also
simplified the test by making the results explicit instead of computed.

* Add method mapping to ViewSet actions

* Document extra action method mapping
2018-07-06 10:33:10 +02:00
..
__init__.py XML cleanup 2013-02-22 19:46:47 +00:00
breadcrumbs.py Improvements to ViewSet extra actions (#5605) 2018-07-06 10:33:10 +02:00
encoders.py Prefer https protocol for links in docs when available 2018-01-15 15:15:21 +01:00
field_mapping.py min_value/max_value support in DurationField (#5643) 2018-04-24 09:24:05 +02:00
formatting.py Simplified chained comparisons and minor code fixes (#5276) 2017-07-16 17:12:29 +01:00
html.py Ensure that html forms (multipart form data) respect optional fields (#5927) 2018-04-20 15:11:52 +02:00
humanize_datetime.py Change ISO 8601 date format to exclude year/month (#5936) 2018-04-14 05:23:31 +01:00
json.py Add docstring to json wrapper module 2017-09-25 09:08:20 +02:00
mediatypes.py Prefer https protocol for links in docs when available 2018-01-15 15:15:21 +01:00
model_meta.py Remove references to unsupported Django versions in docs and code (#5602) 2017-11-20 09:35:54 +01:00
representation.py Remove Django 1.8 & 1.9 compatibility code (#5481) 2017-10-05 20:41:38 +02:00
serializer_helpers.py Stop JSONBoundField mangling invalid JSON (#5526) (#5527) 2017-10-25 10:54:38 +02:00
urls.py fix processing unicode symbols in query_string by Python 2 (#5552) 2017-11-06 11:46:37 +01:00