Projet

Général

Profil

0003-general-allow-slicing-querysets-43328.patch

Frédéric Péters, 29 juin 2020 20:57

Télécharger (854 octets)

Voir les différences:

Subject: [PATCH 3/4] general: allow slicing querysets (#43328)

 wcs/variables.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
wcs/variables.py
139 139

  
140 140
    def __getitem__(self, key):
141 141
        try:
142
            int(key)
142
            if not isinstance(key, slice):
143
                int(key)
143 144
        except ValueError:
144 145
            # A django template doing formdef.objects.drafts would start by
145 146
            # doing ['drafts'], that would raise TypeError and then continue
146
-