[Answer]-Django – Cannot resolve keyword

1👍

The simple answer is that you can’t do this with the filter() method. filter() is used to construct SQL queries and can only operate on objects at the database level.

So you should figure out how to phrase your query using the database values. It’s not clear what your actual code is, but it might look something like:

european_team_list = Team.objects.filter(continent='Europe')

or:

european_team_list = Team.objects.filter(country__in=('France', 'Poland'))

Leave a comment