Opened 6 years ago

Last modified 6 years ago

#29643 closed Bug

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

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

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

traceback ends to this file:
/django/utils/tree.py" in hash

  1. 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 (0)

Note: See TracTickets for help on using tickets.
Back to Top