def test_with_join_exclude(self):
self.assertSequenceEqual(
Author.objects.annotate(
book_alice=FilteredRelation('book', condition=Q(book__title__iexact='poem by alice')),
).exclude(book_alice__isnull=False),
[]
)
I get the following error : django.core.exceptions.FieldError: Cannot resolve keyword 'book_alice' into field. Choices are: book, content_object, content_type, content_type_id, favorite_books, id, name, object_id
I think the issue comme from the function split_exclude(self, filter_expr, can_reuse, names_with_path) because it create a new Query without the _filtered_relations datas.
How can I manage to do this ?