* Use compat version of collections.abc.Mapping
Since the Mapping class will no longer be available to import directly
from the collections module in Python 3.8, we should use the
compatibility helper introduced in #6154 in the fields module.
* Alias and use compat version of collections.abc.MutableMapping
Since the MutableMapping class will no longer be available to import
directly from the collections module in Python 3.8, we should create an
alias for it in the compat module and use that instead.
see https://github.com/encode/django-rest-framework/issues/5660
Trying to register new routes on a router after having accessed the
router `urls` attribute leads to surprising results.
The route is added without error to the router's `registry` but the urls
are not updated, because they are cached in `_urls`.
This commit invalidates the cache after each new registration.
* Add test that verifies that HTML is correctly escaped in Browsable API views
* Fix `urlize_quoted_links` tag to avoid double escaping in autoescape mode
* Fix XSS in default DRF Browsable API template by re-enabling autoescape
* Fix issue1811: take limit_choices_to into account with FK
* Issue 1811: Add tests to illustrate issue
* Filter queryset only if limit_choices_to exists
* Move test_relations_with_limited_querysets file within test_relations_pk
* move limit_choices_to logic from relations.py to utils/field_mapping.py
* move limit_choices_to above other check to avoid conflicts
* compat: (py2) urlparse = urllib.parse (py3)
We were mistakenly importing the 'urlparse' function from the Python 2
'urlparse' module, as opposed to the module itself. Correct this.
Signed-off-by: Stephen Finucane <stephen@that.guru>
Closes: #6261
* compat: Remove 'compat.urlparse'
We can just use Django's vendored six library, like we do everywhere
else.
Signed-off-by: Stephen Finucane <stephen@that.guru>
* Update quickstart to Django 2.0 routing syntax
* Remove uneccessary raw string identifiers
* Correctly import path function
* Fix import path to use django.urls
This is what is prescribed in the Django 2.1 tutorial