#25556: Add DatePart db expression to allow complex lookups on date parts (e.g.
year, month, day)
----------------------------------------------+----------------------------
     Reporter:  ryuusenshi                    |      Owner:  nobody
         Type:  New feature                   |     Status:  new
    Component:  Database layer (models, ORM)  |    Version:  1.9a1
     Severity:  Normal                        |   Keywords:  db expressions
 Triage Stage:  Unreviewed                    |  Has patch:  1
Easy pickings:  1                             |      UI/UX:  0
----------------------------------------------+----------------------------
 Currently it is not possible to filter by matching the year/month/day part
 of two separate date fields.

 I propose something to the effect of:


 {{{
 from django.db.models.expressions import DatePart

 MyModel.objects.filter(date1__month=DatePart('date2', 'month'))
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25556>
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 post to this group, send email to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/053.f921e32504a031fcadbdadf0b86c7e28%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to