GenericForeignKey Deep Filtering | Baptiste Mispelon

https://blog.bmispelon.rocks/articles/2024/2024-11-25-genericforeignkey-deep-filtering.html

Via https://mastodon.social/@bmispelon/113544522780508772

4 points · 1 comments · view on lemmy.world

1 Comments

Michal@programming.dev · 2 pts · 1y

Good idea to use WHEN, but I'm not sure the code example is self explanatory enough

LogEntry.objects.filter(is_affected(USER))

Its possible to implement custom lookups in django, that may be a better interface for this.