[Fixed]-How to construct django Q object matching none

17👍

Q(pk__in=[]) should do the trick.

7👍

Q(pk=None) works fine.

Q(pk__in=[]) works fine as well and doesn’t hit the database.

Leave a comment