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.
* 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.
...
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.
* 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
* Use py36 on travis
* Remove basepython from tox
* Use py27 on travis
* Use version ranges for dependencies
* Use tox-travis to sync python/env factors
* Add toxenv/django env vars to codecov build vars
* Use raw string to fix py36 invalid escape sequence
* Add test for disabling declared fields on child
* Check that declared base field is not in attrs
* Update meta inheritance docs to include serializer
* Test that meta fields cannot be declared as None
* Add docs example for declarative field disabling
* add failing testcase for breadcrumb suffixes missing when using ModelViewSets
* fix get_breadcrumbs to honor overridden get_view_name and keep viewset suffixes
* ensure suffixes are appended in breadcrumb util
This commit fixes the issue when you set the keyword argument `source`
and your have not set the serializer fields explicitly. Then the
construction of field failed because there is not actually any model
field with that name.
However, you are still able to imply the name of model field by
providing the `source` keyword argument.
This is to address https://github.com/tomchristie/django-rest-raml/issues/5
The problem is that if you try to generate RAML docs when you haven't set up any views, you get the above error (min called on an empty list).
unfortunately, this PR is not very helpful since it doesn't actually surface a readable error to the user. Not sure what the best way to address this would be...
To do `GROUP_BY` queries in django requires one to use `.values()`
eg this groups posts by user getting a count of posts per user.
```
Posts.objects.order_by('user').values('user').annotate(post_count=Count('post'))
```
This would produce a value queryset which serializes its result
objects as dictionaries while `CursorPagination` requires a queryset
with result objects that are model instances.
This commit enables cursor pagination for value querysets.
- had to mangle the tests a bit to test it out. They might need
some refactoring.
- tried the same for `.values_list()` but it turned out to be
trickier than I expected since you have to use tuple indexes.
Since `str` objects are immutable, appending to existing `str` creates
in fact a new `str` instance.
Thus `ErrorDetail.detail.code` attribute is lost after `str` concatenation operation.
when using with django-filter and rest_framework_swagger need to import coreapi before django-filter as django filter tries to load rest_framework.coreapi which is undefined at this point
* Start test case
* Added 'requests' test client
* Address typos
* Graceful fallback if requests is not installed.
* Add cookie support
* Tests for auth and CSRF
* Py3 compat
* py3 compat
* py3 compat
* Add get_requests_client
* Added SchemaGenerator.should_include_link
* add settings for html cutoff on related fields
* Router doesn't work if prefix is blank, though project urls.py handles prefix
* Fix Django 1.10 to-many deprecation
* Add django.core.urlresolvers compatibility
* Update django-filter & django-guardian
* Check for empty router prefix; adjust URL accordingly
It's easiest to fix this issue after we have made the regex. To try
to fix it before would require doing something different for List vs
Detail, which means we'd have to know which type of url we're
constructing before acting accordingly.
* Fix misc django deprecations
* Use TOC extension instead of header
* Fix deprecations for py3k
* Add py3k compatibility to is_simple_callable
* Add is_simple_callable tests
* Drop python 3.2 support (EOL, Dropped by Django)
* schema_renderers= should *set* the renderers, not append to them.
* API client (#4424)
* Fix release notes
* Add note about 'User account is disabled.' vs 'Unable to log in'
* Clean up schema generation (#4527)
* Handle multiple methods on custom action (#4529)
* RequestsClient, CoreAPIClient
* exclude_from_schema
* Added 'get_schema_view()' shortcut
* Added schema descriptions
* Better descriptions for schemas
* Add type annotation to schema generation
* Coerce schema 'pk' in path to actual field name
* Deprecations move into assertion errors
* Use get_schema_view in tests
* Updte CoreJSON media type
* Handle schema structure correctly when path prefixs exist. Closes#4401
* Add PendingDeprecation to Router schema generation.
* Added SCHEMA_COERCE_PATH_PK and SCHEMA_COERCE_METHOD_NAMES
* Renamed and documented 'get_schema_fields' interface.