mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-23 10:03:57 +03:00
f2452936e9
The user may wish to provide a dynamic queryset on a `RelatedField` based on the `context`. The way to do that is to create a subclass of `RelatedField` (or a child) and override the `get_queryset` method. However, this is undocumented, and instantiating that field without a `queryset` argument (because it's not needed) will raise an assertion error. Document `.get_queryset(self)` as an official part of the API of `RelatedField`, and don't enforce the use of `queryset` when `get_queryset` is overridden. |
||
---|---|---|
.. | ||
authentication.md | ||
content-negotiation.md | ||
exceptions.md | ||
fields.md | ||
filtering.md | ||
format-suffixes.md | ||
generic-views.md | ||
metadata.md | ||
pagination.md | ||
parsers.md | ||
permissions.md | ||
relations.md | ||
renderers.md | ||
requests.md | ||
responses.md | ||
reverse.md | ||
routers.md | ||
serializers.md | ||
settings.md | ||
status-codes.md | ||
testing.md | ||
throttling.md | ||
validators.md | ||
versioning.md | ||
views.md | ||
viewsets.md |