#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 django-updates+unsubscr...@googlegroups.com. To post to this group, send email to django-updates@googlegroups.com. 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.