Changes between Version 2 and Version 4 of Ticket #27332
- Timestamp:
- Oct 10, 2016, 5:02:14 PM (8 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #27332
- Property Type Uncategorized → New feature
-
Ticket #27332 – Description
v2 v4 1 1 For example, this raw SQL: 2 2 {{{ 3 #!sql 3 4 SELECT event.* 4 5 FROM event … … 15 16 16 17 {{{ 17 from django.db.models import Q 18 from django.db.models.functions import Coalesce 19 18 #!python 20 19 Event.objects.filter(Q(pk__in=Like.objects.filter(person_id=1, content_type_id=17).prefetch_related('content_object').values_list('object_id', flat=True)) | Q(business__manager_id=1)).order_by(Coalesce('likes__date', 'when').desc()) 21 20 }}}