Changes between Version 1 and Version 3 of Ticket #32418
- Timestamp:
- Feb 4, 2021, 8:50:30 AM (4 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #32418
- Property Summary Django f expressions seems to not work with MySQL → F() expressions crash due to some interval/duration error on MySQL.
- Property Component Uncategorized → Database layer (models, ORM)
- Property Resolution → duplicate
- Property Status new → closed
-
Ticket #32418 – Description
v1 v3 14 14 Q(booking_dt__gte=next_interval)) | 15 15 Q(Q(booking_end__lte=first_interval), 16 Q(booking_end__gte=next_interval)))duration_expression = ExpressionWrapper(17 datetime.timedelta(minutes=1) * F('duration'),18 output_field=DurationField())19 booking_end = ExpressionWrapper(20 F('booking_dt') + duration_expression,21 output_field=DateTimeField())22 booking_qs.annotate(23 booking_end=booking_end).get(24 Q(Q(booking_dt__lte=first_interval),25 Q(booking_dt__gte=next_interval)) |26 Q(Q(booking_end__lte=first_interval),27 16 Q(booking_end__gte=next_interval))) 28 17 }}} 29 18 30 31 32 19 Error I get: 33 34 20 35 21 {{{