The Wire · Showcase
Django Restores Legacy Model.from_db() After Fetch Modes Broke It
By RepoJournal · Filed · About Django
If you've overridden Model.from_db() with the classic four-argument signature, your code was silently breaking on Django's main branch, and a merged fix restores it.
The fetch modes feature introduced a breaking change in all query iteration paths, causing a TypeError for models with the documented from_db(cls, db, field_names, values) signature [1]. Adam Johnson's fix detects once per query whether the model's from_db() accepts fetch_mode, restoring backward compatibility without a per-row performance hit [2]. Separately, Varun Kasyap's long-awaited PR switches integration testing from Selenium to Playwright, aiming to "improve test reliability, performance, and developer experience for Django core contributors" [3], with a refreshed version now under review [4]. A companion skip condition was also added to stabilize a foreign key test [5]. Behind the scenes, django-asv is simply accumulating CI results for ubuntu-latest [6]. This is a busy period, with 5 commits and 4 PRs across the two repos, all pointing toward Django hardening its query layer and modernizing its test tooling.
One email a day. Unsubscribe in one click.
Keep up with Django in about 3 minutes a day: what actually shipped — the commits, pull requests, releases, and security advisories that matter.
One email a day. Unsubscribe in one click. Read a past issue →
Action items
- → If you maintain a custom Model.from_db() override, verify compatibility with the fetch_mode change and rebase on the merged fix django/django [immediate]
- → Track the Playwright integration testing PR for when it lands, as it will replace Selenium in CI django/django [monitor]
- → No action needed for django-asv; the commit is CI-only django/django-asv [monitor]
References
- [1] Fixed #37259 -- Restored support for old-signature Model.from_db() overrides. ↗ django/django
- [2] Fixed #37259 -- Restored support for old-signature Model.from_db() overrides. django/django
- [3] Fixed #37154, #37149 -- Switched from Selenium to Playwright for integration testing. ↗ django/django
- [4] Fixed #37154, #37149 -- Switched from Selenium to Playwright for integration testing. django/django
- [5] Refs #37260 -- Added missing skip condition to test_fk_alter_on_delete_db_level. django/django
- [6] Results for ubuntu-latest added [skip ci] django/django-asv