CodeYellowBV / django-binder

A framework based on Django for SPA webapps with a REST-like API
MIT License
14 stars 18 forks source link

Searches on related fields (can) cause duplicate results #111

Open sjamaan opened 5 years ago

sjamaan commented 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.

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):

sjamaan commented 5 years ago

My current workaround involves crafting a custom search() method which adds an Exists annotation and searches on that, instead.