113 wires and counting

$ follow Django

Keep up with Django in about 3 minutes: what actually shipped — the commits, pull requests, releases, and security advisories that matter.

or

fair warning: these emails are deeply technical. diffs, version numbers, CVEs, benchmark deltas. if that's not your idea of a good read, this isn't your newsletter.

Folds into your digest — weekly by default, monthly if you prefer. Unsubscribe in one click.

$ status

wire 2026-09-03
stories 17

© 2026 RepoJournal Home Showcase Explore How it works Privacy

$ the-wire · showcase

Django fixes two query regressions in ORM

By RepoJournal · Filed · About Django

Two regressions in the Django ORM, one in distinct() on PostgreSQL and one in in_bulk(), are fixed in pull requests submitted this week.

Django's ORM has two targeted fixes in flight [1] [2]. QuerySet.distinct() crashed on PostgreSQL with "SELECT DISTINCT ON expressions must match initial" when two lookup paths resolved to the same column and values() selected it at multiple positions. The crash was a regression introduced in 65ad4ade; the fix aligns the DISTINCT ON binding with the first selected position. Separately, QuerySet.in_bulk() dropped selected annotations and extra-select aliases when the mapping key field wasn't selected, because it rebuilt values() and values_list() projections from query.values_select instead of the complete selected projection. The patch rebuilds from query.selected and adds regression tests.

A third ORM fix prevents iterator right-hand sides from being consumed in annotation lookups [3]. When the left-hand side of an in or range lookup is an annotation, the right-hand side iterator is now materialized once before checking its values for expressions, so it can't be exhausted prematurely. The fix covers both lookup types and updates the Django 6.1.1 release notes.

Documentation gets two additions: the core developers page on djangoproject.com now links to the historical Django Core Developers page, addressing issue #2747 [4] [5]. Django's docs also gain the remaining community package mentions, covering everything except the environment configuration section [6]. One more doc change clarifies object-level permission checks in the admin [7], aiming to reduce misplaced security reports. Note that the community packages PR has an AI assistance disclosure, though the assistant checkbox state is not confirmed.

On the infrastructure side, django-asv benchmark results for ubuntu-latest were added to the repository [8].

Action items

References

  1. [1] Fixed #37222 -- Fixed QuerySet.distinct() crash on duplicated selections. ↗ django/django
  2. [2] Fixed #37312, Refs #36605 -- Fixed annotation preservation and key selection in in_bulk(). ↗ django/django
  3. [3] Fixed #37311 -- Prevented consumption of rhs iterators in annotation lookups. ↗ django/django
  4. [4] Added core developers link to teams page (#2808) ↗ django/djangoproject.com
  5. [5] Updates team page to link django core developers ↗ django/djangoproject.com
  6. [6] Added remaining community package mentions to the documentation. ↗ django/django
  7. [7] Clarified object-level permission checks in the admin. ↗ django/django
  8. [8] Results for ubuntu-latest added [skip ci] ↗ django/django-asv

Quick answers

What shipped in Django on September 3, 2026?
Two regressions in the Django ORM, one in distinct() on PostgreSQL and one in in_bulk(), are fixed in pull requests submitted this week. In total, 11 commits and 6 pull requests landed.
Who contributed to Django on September 3, 2026?
5 developers shipped this update, including Andrew Selzer, tim-schilling, davegaeddert, yassinbahri, and sarahboyce.
What were the notable Django updates?
Fixed #37222 -- Fixed QuerySet.distinct() crash on duplicated selections, Fixed #37312, Refs #36605 -- Fixed annotation preservation and key selection in in_bulk(), and Fixed #37311 -- Prevented consumption of rhs iterators in annotation lookups.