Opened 7 years ago

Last modified 7 years ago

#28815 closed Bug

Docs outdated after django.db.models.functions introduced — at Version 1

Reported by: benjaoming Owned by: nobody
Component: Documentation Version: dev
Severity: Normal Keywords:
Cc: Triage Stage: Ready for checkin
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: yes UI/UX: no

Description (last modified by benjaoming)

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

Change History (1)

comment:1 by benjaoming, 7 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.
Back to Top