Changes between Initial Version and Version 1 of Ticket #31486, comment 9


Ignore:
Timestamp:
Feb 3, 2022, 4:11:17 PM (3 years ago)
Author:
raydeal

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #31486, comment 9

    initial v1  
    55>
    66> I've also tried to implement it in  `RelatedLookupMixin.get_prep_lookup` based on [https://github.com/django/django/pull/12768#discussion_r412882870 Mariusz comment on PR], but still same problem. the `lhs` and `rhs` have the same value in `p2.choice_set.all()` and `Choice.objects.filter(poll=p2)` cases.
    7 After looking at code and trying implement solution, my conclusion is: it is connected with #19580, if FK raises ValueError like M2M does it will open door to fix this without a struggle how to distinguish between `p2.choice_set.all()` and `Choice.objects.filter(poll=p2)` because first case will raise ValueError before `filter` is evaluated.
     7After looking at code and trying implement yours solution, my conclusion is: it is connected with #19580, if FK raises ValueError like M2M does it will open door to fix this without a struggle how to distinguish between `p2.choice_set.all()` and `Choice.objects.filter(poll=p2)` because first case will raise ValueError before `filter` is evaluated.
Back to Top