#18969: ORM filtering with "year" lookup for dates
---------------------------------+--------------------------------------
     Reporter:  saippuakauppias  |                    Owner:  nobody
         Type:  Bug              |                   Status:  new
    Component:  ORM aggregation  |                  Version:  1.3
     Severity:  Normal           |               Resolution:
     Keywords:                   |             Triage Stage:  Unreviewed
    Has patch:  1                |      Needs documentation:  0
  Needs tests:  0                |  Patch needs improvement:  0
Easy pickings:  0                |                    UI/UX:  0
---------------------------------+--------------------------------------
Changes (by dirigeant):

 * cc: dirigeant (added)
 * needs_better_patch:   => 0
 * has_patch:  0 => 1
 * needs_tests:   => 0
 * needs_docs:   => 0


Comment:

 Attached patch fixes this issue for all common db backends

 {{{
 User.objects.filter(last_login__year='01').values_list("last_login").query
 SELECT "auth_user"."last_login" FROM "auth_user" WHERE
 "auth_user"."last_login" BETWEEN 0001-01-01 and 0001-12-31 23:59:59.999999
 }}}

-- 
Ticket URL: <https://code.djangoproject.com/ticket/18969#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 post to this group, send email to django-updates@googlegroups.com.
To unsubscribe from this group, send email to 
django-updates+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to