mirror of
https://github.com/django/django.git
synced 2025-11-07 07:15:35 +00:00
Improved error message when index in __getitem__() is invalid.
This commit is contained in:
committed by
Mariusz Felisiak
parent
8323691de0
commit
d89053585e
@@ -63,7 +63,10 @@ class BoundField:
|
||||
# Prevent unnecessary reevaluation when accessing BoundField's attrs
|
||||
# from templates.
|
||||
if not isinstance(idx, (int, slice)):
|
||||
raise TypeError
|
||||
raise TypeError(
|
||||
'BoundField indices must be integers or slices, not %s.'
|
||||
% type(idx).__name__
|
||||
)
|
||||
return self.subwidgets[idx]
|
||||
|
||||
@property
|
||||
|
||||
Reference in New Issue
Block a user