mirror of
https://github.com/encode/django-rest-framework.git
synced 2024-11-10 19:56:59 +03:00
Note possibility of overriding get_queryset
This commit is contained in:
parent
389b48e394
commit
a19f152065
|
@ -75,7 +75,7 @@ class RelatedField(Field):
|
||||||
if not method_overridden('get_queryset', RelatedField, self):
|
if not method_overridden('get_queryset', RelatedField, self):
|
||||||
assert self.queryset is not None or kwargs.get('read_only', None), (
|
assert self.queryset is not None or kwargs.get('read_only', None), (
|
||||||
'Relational field must provide a `queryset` argument, '
|
'Relational field must provide a `queryset` argument, '
|
||||||
'or set read_only=`True`.'
|
'override `get_queryset`, or set read_only=`True`.'
|
||||||
)
|
)
|
||||||
assert not (self.queryset is not None and kwargs.get('read_only', None)), (
|
assert not (self.queryset is not None and kwargs.get('read_only', None)), (
|
||||||
'Relational fields should not provide a `queryset` argument, '
|
'Relational fields should not provide a `queryset` argument, '
|
||||||
|
|
Loading…
Reference in New Issue
Block a user