Limit number of queryset results by html_cutoff

This commit is contained in:
blag 2016-01-26 19:49:31 -07:00
parent 72372efdb6
commit e7060772b3

View File

@ -164,6 +164,9 @@ class RelatedField(Field):
# even when accessed with a read-only field. # even when accessed with a read-only field.
return {} return {}
if self.html_cutoff is not None:
queryset = queryset[:self.html_cutoff]
return OrderedDict([ return OrderedDict([
( (
six.text_type(self.to_representation(item)), six.text_type(self.to_representation(item)),