mirror of
https://github.com/encode/django-rest-framework.git
synced 2025-08-08 06:14:47 +03:00
Limit number of queryset results by html_cutoff
This commit is contained in:
parent
72372efdb6
commit
e7060772b3
|
@ -164,6 +164,9 @@ class RelatedField(Field):
|
|||
# even when accessed with a read-only field.
|
||||
return {}
|
||||
|
||||
if self.html_cutoff is not None:
|
||||
queryset = queryset[:self.html_cutoff]
|
||||
|
||||
return OrderedDict([
|
||||
(
|
||||
six.text_type(self.to_representation(item)),
|
||||
|
|
Loading…
Reference in New Issue
Block a user