[Django] #28103: Add ExtractQuarter to DateField

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[Django] #28103: Add ExtractQuarter to DateField

Django
#28103: Add ExtractQuarter to DateField
-------------------------------------+-------------------------------------
               Reporter:  Matthew    |          Owner:  nobody
  Pava                               |
                   Type:  New        |         Status:  new
  feature                            |
              Component:  Database   |        Version:  1.11
  layer (models, ORM)                |
               Severity:  Normal     |       Keywords:  ORM Extract Trunc
           Triage Stage:             |      Has patch:  0
  Unreviewed                         |
    Needs documentation:  0          |    Needs tests:  0
Patch needs improvement:  0          |  Easy pickings:  1
                  UI/UX:  0          |
-------------------------------------+-------------------------------------
 I was able to successfully add it to my project, but it seems so basic and
 general that I would like to see it added to Django.

 {{{
 class ExtractQuarter(Extract):
     lookup_name = "quarter"

 DateField.register_lookup(ExtractQuarter)
 }}}

 You probably also want to add a corresponding Trunc function, though I
 haven't tested it.
 {{{
 class TruncQuarter(TruncBase):
     kind = "quarter"
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28103>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/049.43c9ddb7d59a0f39d07dc6e724f7875b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField (was: Add ExtractQuarter to DateField)

Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * version:  1.11 => master
 * stage:  Unreviewed => Accepted


--
Ticket URL: <https://code.djangoproject.com/ticket/28103#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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.5b7d753ad0a6374b208ac448889e469b%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField

Django
In reply to this post by Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by felixxm):

 * cc: felixxm (added)


--
Ticket URL: <https://code.djangoproject.com/ticket/28103#comment:2>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.262c39ea2fadc389c23d92051f6e210d%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField

Django
In reply to this post by Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  nobody
         Type:  New feature          |                   Status:  new
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  0                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by felixxm):

 You can take a look at very similar #25240 ticket.

--
Ticket URL: <https://code.djangoproject.com/ticket/28103#comment:3>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.2a5130059f85455ec766dba4fa6adeb2%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField

Django
In reply to this post by Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  Mads
                                     |  Jensen
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  1                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mads Jensen):

 * owner:  nobody => Mads Jensen
 * status:  new => assigned
 * has_patch:  0 => 1


Comment:

 [https://github.com/django/django/pull/8382 PR]

--
Ticket URL: <https://code.djangoproject.com/ticket/28103#comment:4>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.af93d98f832b72a34bbf1c8e55f70235%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField

Django
In reply to this post by Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  Mads
                                     |  Jensen
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham):

 * needs_better_patch:  0 => 1
 * easy:  1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28103#comment:5>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.ca0eae620ce251e774bfece7cd262f92%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField

Django
In reply to this post by Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  Mads
                                     |  Jensen
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  1
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------

Comment (by Mads Jensen):

 Oracle and PostgreSQL have built-in functionality for truncating a date to
 the first month of a quarter. However, in Oracle, it rounds up
 (https://docs.oracle.com/database/121/SQLRF/functions271.htm#SQLRF52058)
 and in PostgreSQL, it's always rounded down
 (https://www.postgresql.org/docs/current/static/functions-datetime.html
 #FUNCTIONS-DATETIME-TRUNC). Neither SQLite or MySQL has a convenient
 built-in functionality and it's a matter of interpretation.

 The Extract functionality is implemented, and has the same behavior on all
 backends.

--
Ticket URL: <https://code.djangoproject.com/ticket/28103#comment:6>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.adce45678adc3820cc67954bbbbf0e3f%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField

Django
In reply to this post by Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  Mads
                                     |  Jensen
         Type:  New feature          |                   Status:  assigned
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Mads Jensen):

 * needs_better_patch:  1 => 0


--
Ticket URL: <https://code.djangoproject.com/ticket/28103#comment:7>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.2aacd04cc19b336cc5621973709f808c%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [Django] #28103: Add "quarter" lookup to DateField/DateTimeField

Django
In reply to this post by Django
#28103: Add "quarter" lookup to DateField/DateTimeField
-------------------------------------+-------------------------------------
     Reporter:  Matthew Pava         |                    Owner:  Mads
                                     |  Jensen
         Type:  New feature          |                   Status:  closed
    Component:  Database layer       |                  Version:  master
  (models, ORM)                      |
     Severity:  Normal               |               Resolution:  fixed
     Keywords:  ORM Extract Trunc    |             Triage Stage:  Accepted
    Has patch:  1                    |      Needs documentation:  0
  Needs tests:  0                    |  Patch needs improvement:  0
Easy pickings:  0                    |                    UI/UX:  0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

 * status:  assigned => closed
 * resolution:   => fixed


Comment:

 In [changeset:"c7f6ffbdcf9ca8df905aebf73336ef9905771f7c" c7f6ffbd]:
 {{{
 #!CommitTicketReference repository=""
 revision="c7f6ffbdcf9ca8df905aebf73336ef9905771f7c"
 Fixed #28103 -- Added quarter extract, truncation, and lookup.

 Thanks Mariusz Felisiak, Tim Graham, and Adam Johnson for review.
 }}}

--
Ticket URL: <https://code.djangoproject.com/ticket/28103#comment:8>
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 [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/django-updates/064.e8c9fa7d88f0f3c6b3fa2048deca72bf%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.
Loading...