It's not possible to frame all logic within filter_exclude and therefore, we should probably introduce a companion.
These filters are quite important for systems that need extra guarantees. There are cases where the set of notified users can fluctuate and inaccuracies can produce small leaks of information to the wrong users. This could be for instance if the consent is stored in another database table that needs to be queried.
Another way to use these filters is to have a dynamic set of subscribers. I.e. you can express "anyone who is currently a superuser" through filter_include={"settings__user__is_superuser": True}
It's not possible to frame all logic within
filter_exclude
and therefore, we should probably introduce a companion.These filters are quite important for systems that need extra guarantees. There are cases where the set of notified users can fluctuate and inaccuracies can produce small leaks of information to the wrong users. This could be for instance if the consent is stored in another database table that needs to be queried.
Another way to use these filters is to have a dynamic set of subscribers. I.e. you can express "anyone who is currently a superuser" through
filter_include={"settings__user__is_superuser": True}
https://github.com/django-wiki/django-nyt/blob/86eafaba5b88e5abdc6bceb815f311b96bd6d62a/django_nyt/utils.py#L14-L60