Changes between Version 3 and Version 4 of Ticket #16609


Ignore:
Timestamp:
Aug 11, 2011, 5:15:17 PM (13 years ago)
Author:
Aymeric Augustin
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #16609 – Description

    v3 v4  
    11I believe this has already been touched upon in #15819, however the consensus (comment ticket:15819#comment:13) was
    22
    3 "For people in situations where .distinct() is broken for whatever reason, the workaround here is simple: don't use search_fields with relations in a way that triggers it."
     3"For people in situations where `.distinct()` is broken for whatever reason, the workaround here is simple: don't use `search_fields` with relations in a way that triggers it."
    44
    55I couldn't find a ticket for this, so here it is.
    66
    7 In my case, I am searching for a keyword which is found in a search_fields item that isn't traversing M2M. When search_fields also contains a M2M traversal, I get duplicate results.
     7In my case, I am searching for a keyword which is found in a `search_fields` item that isn't traversing M2M. When `search_fields` also contains a M2M traversal, I get duplicate results.
    88
    9 In my case - this might be relevant or not - I am traversing a ForeignKey first and then an M2M field in that problematic search_fields entry, e.g:
     9In my case - this might be relevant or not - I am traversing a !ForeignKey first and then an M2M field in that problematic search_fields entry, e.g:
    1010
    1111{{{
     
    1313}}}
    1414
    15 This happens even though the string is not matched by fkmodel__m2mmodel__name, only by id.
     15This happens even though the string is not matched by `fkmodel__m2mmodel__name`, only by `id`.
    1616
    1717This might not be clear, this is what the model relations look like:
     
    2121}}}
    2222
    23 M2MModel contains the name field that I have specified in search_fields.
     23M2MModel contains the name field that I have specified in `search_fields`.
    2424
    2525This might or might not be related to #15559.
Back to Top