NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #4642 most downloaded on PyPI
Common Table Expressions (CTE) for Django
Last release 3 days ago
01 Oct 2026
Release timing varies
gaps range from 2 weeks to 5 months
Nearly every release is documented
notes for 21 of 21 stable releases
Nothing withdrawn
no release was ever pulled
9 years old
42 releases · first in 2018
BREAKING Dropped support for Python 3.9 (EOL 2025-10-31).
db_column.Nothing published for this version
Nothing published for this version
One column per quarter.
Nothing published for this version
BREAKING: on Django 5.2 and later when joining a CTE to a queryset with LEFT OUTER JOIN (_join_type=LOUTER) and the join condition implicitly joins a
_join_type=LOUTER) and the join condition implicitly joins
a related table, the implicit join is now a LEFT OUTER JOIN instead of an
INNER JOIN. This makes the join behavior match SQL database semantics: the
left-side rows are always preserved. To restore the old behavior, either
do not use _join_type=LOUTER or add extra WHERE conditions as needed.
See #130 for more details.CTE.queryset() queries involving aggregates (#128).CTE.queryset() regression (#124).Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
With has been renamed to CTE. With is deprecated and will be removed in a future version of django-cte.
With has been renamed to CTE. With is deprecated and will be removed
in a future version of django-cte.with_cte was moved from a CTEQuerySet method to a stand-alone function.CTEManager and CTEQuerySet are deprecated and should be removed from
code that uses them, as they are no longer necessary. They will be removed
in a future version of django-cte..values('fk_name') must match the name of the same column referenced by
cte.col.fk_name—for example, in a join condition. It may end with _id or
not, but the references must be consistent. This change may require previously
working CTE queries to be adjusted when migrating to Django 5.2
(example).UNION and other "combined" queries.Nothing published for this version
Nothing published for this version
Nothing published for this version
Prepare for v1.3.3 release
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Prepare for 1.3.2 release
Prepare for 1.3.2 release
Prepare for v1.3.1 release
Prepare for v1.3.1 release
.update() did not work when using CTE manager or when accessing nested
tables.Add support for Materialized CTEs.
.explain() method.Bump version to 1.2.1 for new release
Bump version to 1.2.1 for new release
Prepare for 1.2.0 release
Prepare for 1.2.0 release
OuterRef in CTE Subquery.CTEManager so it can use from_queryset corectly.Django 3 compatibility. Thank you @tim-schilling and @ryanhiebert!
- Python 3 compatibility.
- Fix CTE alias bug.
Use _default_manager instead of objects.
_default_manager instead of objects.Fix recursive CTE pickling. Note: this is currently broken on Django master.
With.queryset() now uses the CTE model's manager to create a new QuerySet, which makes it easier to work with custom QuerySet classes.
With.queryset() now uses the CTE model's manager to create a new QuerySet,
which makes it easier to work with custom QuerySet classes.BACKWARD INCOMPATIBLE CHANGE: With.queryset() no longer accepts a model argument.
With.queryset() no longer accepts a model
argument.With.queryset() to select directly from the CTE rather than
joining to anoter QuerySet.With.join() to use real JOIN clause.Fix related field attname masking CTE column.
Add django_cte.raw.raw_cte_sql for constructing CTEs with raw SQL.
django_cte.raw.raw_cte_sql for constructing CTEs with raw SQL.Improve error on bad recursive reference.
- Fix readme formatting on PyPI.
- Initial implementation.
Your coding agent can read these notes before it upgrades. Set up the MCP server →