Open sjamaan opened 5 years ago
When using search for related fields that end in multiple records, binder may return the same record more than once, depending on circumstances.
search
The same issue also happens when using a Q() object in a permission filter that traverses a relation into a "many" side.
Q()
Example (untested yet):
searches = ['animals__name__icontains']
CaretakerView
id
My current workaround involves crafting a custom search() method which adds an Exists annotation and searches on that, instead.
search()
Exists
When using
search
for related fields that end in multiple records, binder may return the same record more than once, depending on circumstances.The same issue also happens when using a
Q()
object in a permission filter that traverses a relation into a "many" side.Example (untested yet):
searches = ['animals__name__icontains']
toCaretakerView
id