| 1 |
# Django CTE change log |
| 2 |
|
| 3 |
## 4.0.0 - 2026-08-28 |
| 4 |
|
| 5 |
- **BREAKING** Dropped support for Python 3.9 (EOL 2025-10-31). |
| 6 |
- Add support for Django 6.1. |
| 7 |
- Fix fields using `db_column`. |
| 8 |
|
| 9 |
## 3.0.0 - 2026-02-05 |
| 10 |
|
| 11 |
- **BREAKING:** on Django 5.2 and later when joining a CTE to a queryset with |
| 12 |
LEFT OUTER JOIN (`_join_type=LOUTER`) and the join condition implicitly joins |
| 13 |
a related table, the implicit join is now a LEFT OUTER JOIN instead of an |
| 14 |
INNER JOIN. This makes the join behavior match SQL database semantics: the |
| 15 |
left-side rows are always preserved. To restore the old behavior, either |
| 16 |
do not use `_join_type=LOUTER` or add extra WHERE conditions as needed. |
| 17 |
See [#130](https://github.com/dimagi/django-cte/pull/130) for more details. |
| 18 |
- Fixed `CTE.queryset()` queries involving aggregates ([#128](https://github.com/dimagi/django-cte/issues/128)). |
| 19 |
- Fixed Django 5.2 ambiguous column names bug ([#127](https://github.com/dimagi/django-cte/issues/127)). |
| 20 |
- Fixed possible ambiguous column names in SQL ([#125](https://github.com/dimagi/django-cte/issues/125)). |
| 21 |
- Fixed Django 5.2 `CTE.queryset()` regression ([#124](https://github.com/dimagi/django-cte/pull/124)). |
| 22 |
|
| 23 |
## 2.0.0 - 2025-06-16 |
| 24 |
|
| 25 |
- **API overhaul** |
| 26 |
- `With` has been renamed to `CTE`. `With` is deprecated and will be removed |
| 27 |
in a future version of django-cte. |
| 28 |
- `with_cte` was moved from a `CTEQuerySet` method to a stand-alone function. |
| 29 |
- `CTEManager` and `CTEQuerySet` are deprecated and should be removed from |
| 30 |
code that uses them, as they are no longer necessary. They will be removed |
| 31 |
in a future version of django-cte. |
| 32 |
- Reference the [documentation](https://dimagi.github.io/django-cte/) for new |
| 33 |
usage patterns. |
| 34 |
- **BREAKING:** On Django 5.2 and later, the name specified in |
| 35 |
`.values('fk_name')` must match the name of the same column referenced by |
| 36 |
`cte.col.fk_name`—for example, in a join condition. It may end with `_id` or |
| 37 |
not, but the references must be consistent. This change may require previously |
| 38 |
working CTE queries to be adjusted when migrating to Django 5.2 |
| 39 |
([example](https://github.com/dimagi/django-cte/commit/321d92cd8d1edd515c1f5000a3b12c35265aa4f8)). |
| 40 |
- Django 5.0 is EOL and no longer supported. |
| 41 |
- Fixed broken `UNION` and other "combined" queries. |
| 42 |
- Internally, the library has been updated to simplify the code and remove |
| 43 |
workarounds for old and unsupported versions of Django. |
| 44 |
- Modernized development tooling |
| 45 |
- Replaced _nosetests_ with _pytest_. |
| 46 |
- Replaced _setup.py_ with _pyproject.toml_ |
| 47 |
- Replaced _flake8_ with _ruff_. |
| 48 |
- Replaced _venv/pip_ with _uv_. |
| 49 |
- Improved Github Actions automation, including automated releases. |
| 50 |
- Dev versions of django-cte are now published on PyPI, making them easier to |
| 51 |
test and use before an official release is cut. |
| 52 |
|
| 53 |
## 1.3.3 - 2024-06-07 |
| 54 |
|
| 55 |
- Handle empty result sets in CTEs ([#92](https://github.com/dimagi/django-cte/pull/92)). |
| 56 |
- Fix `.explain()` in Django >= 4.0 ([#91](https://github.com/dimagi/django-cte/pull/91)). |
| 57 |
- Fixed bug in deferred loading ([#90](https://github.com/dimagi/django-cte/pull/90)). |
| 58 |
|
| 59 |
## 1.3.2 - 2023-11-20 |
| 60 |
|
| 61 |
- Work around changes in Django 4.2 that broke CTE queries due to internally |
| 62 |
generated column aliases in the query compiler. The workaround is not always |
| 63 |
effective. Some queries will produce mal-formed SQL. For example, CTE queries |
| 64 |
with window functions. |
| 65 |
|
| 66 |
## 1.3.1 - 2023-06-13 |
| 67 |
|
| 68 |
- Fix: `.update()` did not work when using CTE manager or when accessing nested |
| 69 |
tables. |
| 70 |
|
| 71 |
## 1.3.0 - 2023-05-24 |
| 72 |
|
| 73 |
- Add support for Materialized CTEs. |
| 74 |
- Fix: add EXPLAIN clause in correct position when using `.explain()` method. |
| 75 |
|
| 76 |
## v1.2.1 - 2022-07-07 |
| 77 |
|
| 78 |
- Fix compatibility with non-CTE models. |
| 79 |
|
| 80 |
## v1.2.0 - 2022-03-30 |
| 81 |
|
| 82 |
- Add support for Django 3.1, 3.2 and 4.0. |
| 83 |
- Quote the CTE table name if needed. |
| 84 |
- Resolve `OuterRef` in CTE `Subquery`. |
| 85 |
- Fix default `CTEManager` so it can use `from_queryset` corectly. |
| 86 |
- Fix for Django 3.0.5+. |
| 87 |
|
| 88 |
## v1.1.5 - 2020-02-07 |
| 89 |
|
| 90 |
- Django 3 compatibility. Thank you @tim-schilling and @ryanhiebert! |
| 91 |
|
| 92 |
## v1.1.4 - 2018-07-30 |
| 93 |
|
| 94 |
- Python 3 compatibility. |
| 95 |
|
| 96 |
## v1.1.3 - 2018-06-19 |
| 97 |
|
| 98 |
- Fix CTE alias bug. |
| 99 |
|
| 100 |
## v1.1.2 - 2018-05-22 |
| 101 |
|
| 102 |
- Use `_default_manager` instead of `objects`. |
| 103 |
|
| 104 |
## v1.1.1 - 2018-04-13 |
| 105 |
|
| 106 |
- Fix recursive CTE pickling. Note: this is currently [broken on Django |
| 107 |
master](https://github.com/django/django/pull/9134#pullrequestreview-112057277). |
| 108 |
|
| 109 |
## v1.1.0 - 2018-04-09 |
| 110 |
|
| 111 |
- `With.queryset()` now uses the CTE model's manager to create a new `QuerySet`, |
| 112 |
which makes it easier to work with custom `QuerySet` classes. |
| 113 |
|
| 114 |
## v1.0.0 - 2018-04-04 |
| 115 |
|
| 116 |
- BACKWARD INCOMPATIBLE CHANGE: `With.queryset()` no longer accepts a `model` |
| 117 |
argument. |
| 118 |
- Improve `With.queryset()` to select directly from the CTE rather than |
| 119 |
joining to anoter QuerySet. |
| 120 |
- Refactor `With.join()` to use real JOIN clause. |
| 121 |
|
| 122 |
## v0.1.4 - 2018-03-21 |
| 123 |
|
| 124 |
- Fix related field attname masking CTE column. |
| 125 |
|
| 126 |
## v0.1.3 - 2018-03-15 |
| 127 |
|
| 128 |
- Add `django_cte.raw.raw_cte_sql` for constructing CTEs with raw SQL. |
| 129 |
|
| 130 |
## v0.1.2 - 2018-02-21 |
| 131 |
|
| 132 |
- Improve error on bad recursive reference. |
| 133 |
- Add more tests. |
| 134 |
- Add change log. |
| 135 |
- Improve README. |
| 136 |
- PEP-8 style fixes. |
| 137 |
|
| 138 |
## v0.1.1 - 2018-02-21 |
| 139 |
|
| 140 |
- Fix readme formatting on PyPI. |
| 141 |
|
| 142 |
## v0.1 - 2018-02-21 |
| 143 |
|
| 144 |
- Initial implementation. |