https://docs.djangoproject.com/en/2.0/ref/models/expressions/#window-
functions
Example:
{{{
>>> from django.db.models import Avg, ExtractYear, F, Window
Traceback (most recent call last):
File "<input>", line 1, in <module>
from django.db.models import Avg, ExtractYear, F, Window
ImportError: cannot import name 'ExtractYear'
}}}
Should these functions be available from `django.db.models`? The module
already contains quite a heavy load of imports....
--
Ticket URL: <https://code.djangoproject.com/ticket/28815>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
Old description:
> Documentation has the wrong location of `ExtractYear`:
>
> https://docs.djangoproject.com/en/2.0/ref/models/expressions/#window-
> functions
>
> Example:
>
> {{{
> >>> from django.db.models import Avg, ExtractYear, F, Window
> Traceback (most recent call last):
> File "<input>", line 1, in <module>
> from django.db.models import Avg, ExtractYear, F, Window
> ImportError: cannot import name 'ExtractYear'
> }}}
>
> Should these functions be available from `django.db.models`? The module
> already contains quite a heavy load of imports....
New description:
Documentation has the wrong location of `ExtractYear`:
https://docs.djangoproject.com/en/2.0/ref/models/expressions/#window-
functions
Example:
{{{
>>> from django.db.models import Avg, ExtractYear, F, Window
Traceback (most recent call last):
File "<input>", line 1, in <module>
from django.db.models import Avg, ExtractYear, F, Window
ImportError: cannot import name 'ExtractYear'
}}}
Should these functions be available from `django.db.models`? The module
already contains quite a heavy load of imports....
References:
`django.db.models.functions.datetime` created in:
https://github.com/django/django/commit/77b73e79a4750dcbfabc528bf00cad81ff5bb4d9
Window expression PR:
https://github.com/django/django/pull/7611/files
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28815#comment:1>
* status: new => closed
* resolution: => fixed
Comment:
In [changeset:"bf49d9eb0b33aefc7179d3843fad0cb7df4e7790" bf49d9eb]:
{{{
#!CommitTicketReference repository=""
revision="bf49d9eb0b33aefc7179d3843fad0cb7df4e7790"
Fixed #28815 -- Fixed ExtractYear imports in
docs/ref/models/expressions.txt.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28815#comment:2>
Comment (by Tim Graham <timograham@…>):
In [changeset:"385e06d8c05ad4e5089295a3bafad2b922fd2763" 385e06d]:
{{{
#!CommitTicketReference repository=""
revision="385e06d8c05ad4e5089295a3bafad2b922fd2763"
[2.0.x] Fixed #28815 -- Fixed ExtractYear imports in
docs/ref/models/expressions.txt.
Backport of bf49d9eb0b33aefc7179d3843fad0cb7df4e7790 from master
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/28815#comment:3>
* type: Uncategorized => Bug
* stage: Unreviewed => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/28815#comment:4>