#33635: Django 3.2.13 raises ProgrammingError "can't adapt type 'LessThan'"
-------------------------------------+-------------------------------------
     Reporter:  Shaheed Haque        |                    Owner:  nobody
         Type:  Bug                  |                   Status:  closed
    Component:  Database layer       |                  Version:  3.2
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  invalid
     Keywords:                       |             Triage Stage:
                                     |  Unreviewed
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => invalid


Comment:

 Django 3.2 is in extended support and doesn't receive bugfixes (except
 security patches) anymore. You can use `Case()` on Django 3.2:
 {{{
 .annotate(past=Case(
     When(Q(end_date__lt=date.today()), then=True),
     default=False,
     output_field=BooleanField(),
 ))
 }}}
 or `ExpressionWrapper()`:
 {{{
 .annotate(past=ExpressionWrapper(
     Q(end_date__lt=date.today()),
     output_field=BooleanField(),
 ))
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/33635#comment:1>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/010701801844c311-c2ada885-73d8-4389-9f9f-8d63e04af176-000000%40eu-central-1.amazonses.com.

Reply via email to