Skip to content
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.
This repository has been archived by the owner on Oct 15, 2018. It is now read-only.

Eliminate duplicates in listing queryset #69

Open
hedleyroos opened this issue Aug 21, 2015 · 4 comments
Open

Eliminate duplicates in listing queryset #69

hedleyroos opened this issue Aug 21, 2015 · 4 comments

Comments

@hedleyroos
Copy link
Contributor

If an object has the same category appear in "primary category" as well as "categories" then it appears twice in a listing.

@jbeyers
Copy link
Contributor

jbeyers commented Mar 3, 2016

Ack, just ran into that on UCM. Probable fix:

models.py, line 368:

- q = q.filter(q1|q2)
+ q = q.filter(q1|q2).distinct()

@qoda
Copy link
Contributor

qoda commented Mar 3, 2016

Be careful to use only() with distinct() as Oracle will fall over if not.

q = q.filter(q1|q2).only("id").distinct()

@qoda
Copy link
Contributor

qoda commented Mar 4, 2016

PR submitted to resolve this: #70

@hedleyroos
Copy link
Contributor Author

I changed #70 a bit so we don't incur any performance penalties. Fix deployed to develop.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants