Opened 6 years ago

Last modified 6 years ago

#29643 closed Bug

Hashing list in Q objects when using __in lookup — at Version 1

Reported by: rhyre Owned by: nobody
Component: Utilities Version: 2.0
Severity: Release blocker Keywords: hash, tuple, list, drf
Cc: Mariusz Felisiak Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description (last modified by rhyre)

When using djangorestframework with django 2.0.X with lookup _in like id__in=[1,2,3] will raise: unhashable type: 'list'

traceback ends to this file:

/django/utils/tree.py" in __hash__
  74.         return hash((self.__class__, self.connector, self.negated) + tuple(self.children))

When using tuples with __in everything works fine. But when using .values_list() on query I need to use tuple(query) to use it in Q object with __in lookup.
Code worked before with 1.11 version just fine. Also when using _in without Q() everything seems to work just fine.

Change History (1)

comment:1 by rhyre, 6 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top