You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, and thanks for your hard work. We've recently started using Bridgekeeper in our application because it seems to provide a lot of flexibility when it comes to defining rules. One stumbling block we've hit, though, is when we do not want to filter using a rule, but instead want to annotate a queryset with the result of the rule.
This is useful for us, e.g. when inaccessible objects in a list should not be omitted but instead marked as such.
We initially tried using the query field of the permission, since django allows annotating using a Q object, but this seems to not work, as the code
In some cases I've seen this trigger duplicate rows in the queryset (as you can't make the Case/When distinct) in which case I've used Count(filter=q, distinct=True, ...) as a work around.
There may be more optimal ways of doing it for your particular query, but that should point you in the right direction!
Hi, and thanks for your hard work. We've recently started using Bridgekeeper in our application because it seems to provide a lot of flexibility when it comes to defining rules. One stumbling block we've hit, though, is when we do not want to filter using a rule, but instead want to annotate a queryset with the result of the rule.
This is useful for us, e.g. when inaccessible objects in a list should not be omitted but instead marked as such.
We initially tried using the
query
field of the permission, since django allows annotating using aQ
object, but this seems to not work, as the codealways evaluates to
True
.A workaround is to perform the filtering query and then annotate by using
in
, but this seems needlessly expensive.It would be great if Bridgekeeper could expose some way to get at an
F
object for use in annotations.The text was updated successfully, but these errors were encountered: