Django: check if value in values_list with & without prefetch_related/select_related
Become part of the top 3% of the developers by applying to Toptal https://topt.al/25cXVn
--
Music by Eric Matyas
https://www.soundimage.org
Track title: Horror Game Menu Looping
--
Chapters
00:00 Question
01:07 Accepted answer (Score 7)
01:28 Thank you
--
Full question
https://stackoverflow.com/questions/1998...
Accepted answer links:
[bug 20242]: https://code.djangoproject.com/ticket/20...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #list #orm
#avk47
    --
Music by Eric Matyas
https://www.soundimage.org
Track title: Horror Game Menu Looping
--
Chapters
00:00 Question
01:07 Accepted answer (Score 7)
01:28 Thank you
--
Full question
https://stackoverflow.com/questions/1998...
Accepted answer links:
[bug 20242]: https://code.djangoproject.com/ticket/20...
--
Content licensed under CC BY-SA
https://meta.stackexchange.com/help/lice...
--
Tags
#python #django #list #orm
#avk47
ACCEPTED ANSWER
Score 7
Are you using Django 1.5?
There was a bug that caused the in lookup to fail when using prefetch_related: bug 20242.
This has been fixed in Django 1.6.