$ the-wire · showcase
Django tutorial cleanup, ModelFormSet prefix fix
By RepoJournal · Filed · About Django
Django merged a docs cleanup that trims the tutorial, and a bug fix that makes ModelFormSet respect custom form prefixes.
Django's tutorial loses an unnecessary section, with the relevant content moved into the models documentation. The change came out of the DjangoCon Europe sprints in Vigo [1]. Separately, docs gain source links for every referenced form template, closing trac ticket 37127 as a documentation-only change [2].
The more consequential code fix: BaseModelFormSet._construct_form() used a hardcoded hyphen separator to build its primary-key lookup, so a form that overrides add_prefix() with a custom separator would fail to associate submitted primary keys in bound model formsets. It now respects the form's own prefix, so those formsets bind correctly [3]. The same fix landed as a commit, confirming it's destined for an upcoming release [4].
Two smaller items round out the day: djangoproject.com fixed two paginator bugs in search results, where orphans were dropped and requesting the 'last' page failed to apply a limit, rendering every result [5]. The site also translates the visually hidden 'Skip to main content' link, which previously appeared in English on every localized page [6]. Finally, Django confirmed support for GEOS 3.15 [7].
Action items
- → Upgrade Django to a version containing the ModelFormSet prefix fix when it releases django/django [plan]
References
- [1] Removing unnecessary section in the second step of the tutorial ↗ django/django
- [2] Fixed #37127 -- Added source links for form templates in docs. ↗ django/django
- [3] Fixed #37145 -- Made ModelFormSet respect custom Form.add_prefix(). ↗ django/django
- [4] Fixed #37145 -- Made ModelFormSet respect custom Form.add_prefix(). ↗ django/django
- [5] Fixed paginator orphans in search results. ↗ django/djangoproject.com
- [6] Translate the "Skip to main content" link ↗ django/djangoproject.com
- [7] Fixed #37313 -- Confirmed support for GEOS 3.15. ↗ django/django