1
0
mirror of https://github.com/django/django.git synced 2025-10-26 07:06:08 +00:00

Fixed #26267 -- Fixed BoundField to reallow slices of subwidgets.

This commit is contained in:
Jon Dufresne
2016-02-23 15:39:20 -08:00
committed by Tim Graham
parent 1ff6e37de4
commit b412681359
5 changed files with 20 additions and 1 deletions

View File

@@ -60,7 +60,7 @@ class BoundField(object):
def __getitem__(self, idx):
# Prevent unnecessary reevaluation when accessing BoundField's attrs
# from templates.
if not isinstance(idx, six.integer_types):
if not isinstance(idx, six.integer_types + (slice,)):
raise TypeError
return list(self.__iter__())[idx]