Changes between Initial Version and Version 2 of Ticket #34413


Ignore:
Timestamp:
Mar 13, 2023, 4:46:41 PM (20 months ago)
Author:
Willem Van Onsem
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #34413

    • Property Needs tests set
  • Ticket #34413 – Description

    initial v2  
    88
    99I did not yet check what querysets will be problematic. For example a sliced queryset would (very likely) not work, and likely most/all restrictions already in place for a the queryset of a `Prefetch` object are still applicable.
     10
     11A simple demonstration of the `PrefetchEarliest` could be:
     12
     13{{{
     14User.objects.prefetch_related(PrefetchEarliest('groups', to_attr='first_group', Group.objects.order_by('name'))
     15}}}
     16
     17This will then annotate `.first_group` to each `User` in the queryset with the group for that user that is by name (lexicographically) first for example.
Back to Top