Say I have a model Person object that has a Name field. And I have a list of people:
l = ['Bob','Dave','Jane']
I would like to return a list of all Person entries where the first name is not in the list of names defined in l.
What is the most pythonic way to do this?
EDIT: Having thought about this, I tried to make sure that the Person list does not contain the list l, which is not in the Person table. Is there an effective way to do this? I can think of several ways, not sure how effective.
source
share