Changes between Initial Version and Version 1 of Ticket #31535


Ignore:
Timestamp:
May 4, 2020, 9:45:21 AM (5 years ago)
Author:
David Cooke
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31535 – Description

    initial v1  
    55SELECT "bug_challenge"."id", "bug_challenge"."name", CASE WHEN "bug_challenge_unlocks"."from_challenge_id" IN (5, 1) THEN True ELSE False END AS "unlocked" FROM "bug_challenge" LEFT OUTER JOIN "bug_challenge_unlocks" ON ("bug_challenge"."id" = "bug_challenge_unlocks"."to_challenge_id")
    66}}}
    7 so it seems like the left outer join is adding the duplicates.
     7so it seems like the left outer join is adding the duplicates although thats needed for the case statement.
    88
    99It is possible to work around this by calling value_list(flat=True).distinct('pk') however isn't compatible with more complicated examples such as https://github.com/ractf/core/blob/master/challenge/views.py#L50
Back to Top