Opened 15 years ago

Closed 15 years ago

#11510 closed (invalid)

Import path for aggregates is incorrect

Reported by: Andy MacKinlay Owned by: nobody
Component: Documentation Version: 1.0
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

All the samples for aggregates at http://docs.djangoproject.com/en/dev/topics/db/aggregation/#topics-db-aggregation show the import path as

>>> from django.db.models import Avg, Max, Min, Count

This results in an ImportError. It should be changed to the correct path:

>>> from django.db.models.aggregates import Avg, Max, Min, Count

Change History (1)

comment:1 by Russell Keith-Magee, 15 years ago

Resolution: invalid
Status: newclosed

The aggregates are imported into the db.models namespace on line 9 of django/db/models/__init__.py.

Note: See TracTickets for help on using tickets.
Back to Top