#35413: FieldError: Unsupported lookup error message can be confusing on
DateTimeField
-------------------------------------+-------------------------------------
               Reporter:  Alex       |          Owner:  nobody
                   Type:  Bug        |         Status:  new
              Component:  Database   |        Version:  5.0
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  0
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 On these example queries on DateTimeFields:

 {{{
 TestModel.objects.filter(created_at__gt__foo='2024-01-01')
 TestModel.objects.filter(created_at__gt__='2024-01-01')  # I'm a bit
 surprised this one also has the same message.
 TestModel.objects.filter(created_at__gt__lt='2024-01-01')
 }}}
 The error message is this
 {{{
 django.core.exceptions.FieldError: Unsupported lookup 'gt' for
 DateTimeField or join on the field not permitted, perhaps you meant gt or
 gte?
 }}}

 The error message should clarify better the issue.
-- 
Ticket URL: <https://code.djangoproject.com/ticket/35413>
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/0107018f297d052f-c995e98b-ad27-44b4-84f6-6aa434ac37b4-000000%40eu-central-1.amazonses.com.

Reply via email to