Important changes
- We now support Django@5.2 LTS release!
- Partial Django support is moved to 5.0 from 4.2
- We now also run all checks in this repo under
mypy --strict
mode - Minimal
mypy
version is updated to1.13
What's Changed
- fix
format_lazy
typing by @ashm-dev in #2504 - Update models's fields'
_Choices
type by @stianjensen in #2476 - fix: Add
context_data
attribute to _MonkeyPatchedW/ASGIResponse. by @PacificGilly in #2509 - Fix id and pk of AnonymousUser by @stickperson in #2515
- Add docs about "
type[Model]
does not haveobjects
attribute" by @sobolevn in #2519 - Update
db.migrations.operations
by @Viicos in #2349 - Add
select_format()
methods by @adamchainz in #2525 - Tidy
django.conf.urls
by @adamchainz in #2528 - Fix
Func.function
by @adamchainz in #2529 - Add
ClassVar
annotations on mutableModelAdmin
types forruff
by @zyv in #2524 - Add
ClassVar
annotations onMigration
class attributes by @zyv in #2530 - Remove insecure password hashers by @adamchainz in #2537
- Update for
Model.[a]save()
signature change by @adamchainz in #2535 - Update TestCase classes for Django 5.1 by @adamchainz in #2540
- Improve admin decorators by @adamchainz in #2538
- Update for template system checks change by @adamchainz in #2536
- Remove ForeignObjectRel.is_hidden() by @adamchainz in #2539
- Correct Field.slice_expression() 'length' argument name. by @adamchainz in #2548
- Update django.urls for Django 5.1 by @adamchainz in #2546
- Update django.db.models.options.Options for Django 5.1 by @adamchainz in #2545
- Add admin is_collapsible() methods by @adamchainz in #2541
- Update django.template for Django 5.1 by @adamchainz in #2543
- Add new system checks from Django 5.1 by @adamchainz in #2542
- Add full signatures to CheckConstraint.init overloads by @adamchainz in #2544
- Make Model.[a]save() keyword-only by @adamchainz in #2550
- Add query_params argument to test tools from Django 5.1 by @adamchainz in #2547
- fix #2552 by add ModelIterable to _need_generic by @lucemia in #2553
- Add window frame exclusion from Django 5.1 by @adamchainz in #2554
- Improve process_view() methods by @adamchainz in #2556
- Update core.files.storages for Django 5.1 by @adamchainz in #2558
- Update contrib.auth for Django 5.1 by @adamchainz in #2555
- Complete JSONObject by @adamchainz in #2560
- Fix FieldCacheMixin.cache_name by @adamchainz in #2562
- Use AbstractContextManager instead of
@contextmanager
by @adamchainz in #2561 - Add ModelForm.declared_fields by @adamchainz in #2557
- Update test.selenium for Django 5.1 by @adamchainz in #2559
- Update database expressions for Django 5.1 by @adamchainz in #2563
- fixed typing in contrib.auth.decorators by @Rusich90 in #2564
- Update
_Choices
type for forms by @mrgalopes in #2565 - Update some database backend attributes for Django 5.1 by @adamchainz in #2567
- Update PostgreSQL backend
is_postgresql_*
properties for Django 5.1 by @adamchainz in #2566 - Remove unused code from the plugin by @ngnpope in #2570
- Add
db_table_comment
to model meta by @ngnpope in #2571 - Fix
BaseModelAdmin.get_inlines()
return type by @MaestroXXXVIII in #2576 - Fix a few typos by @UnknownPlatypus in #2579
- Document custom field typing by @UnknownPlatypus in #2578
- Improve stubs for
flatten
andflatten_fieldsets
by @ngnpope in #2572 - Improve typing of choices by @ngnpope in #2582
- Run tests in parallel by @UnknownPlatypus in #2580
- Make GeneratedField parameter db_persist required by @JasonLovesDoggo in #2568
- Re-add explicit test cache disabling by @UnknownPlatypus in #2589
- Ignore
__slotnames__
by @adamchainz in #2584 - Update a bunch of stuff for Django 5.1 by @adamchainz in #2585
- Add get_refs() to BaseExpression and WhereNode by @adamchainz in #2586
- Update Django 4.2 LTS version to 4.2.20 by @intgr in #2592
- Allow tuples for some
TypedModelMeta
fields by @ngnpope in #2594 - Update
django.contrib.gis.geoip2
stubs by @ngnpope in #2593 - Update django to 5.2 by @sobolevn in #2596
- Fix django.urls.base.reverse after 5.2 by @simwr872 in #2595
- Update
django.core.validators
for Django 5.2 by @JaeHyuckSa in #2598 - Update
django.test.client
anddjango.utils
for Django 5.2 by @JaeHyuckSa in #2599 - Update
django.contrib.auth.backends
for Django 5.2 by @JaeHyuckSa in #2600 - Update
django.contrib.auth.models
for Django 5.2 by @JaeHyuckSa in #2601 - Allow
MutableMapping
forForm.Initial
by @UnknownPlatypus in #2604 - Update
django.contrib.admin
for Django 5.2 by @JaeHyuckSa in #2607 - Update
django.db.models.sql
for Django 5.2 by @JaeHyuckSa in #2606 - Update
django.forms.widgets
for Django 5.2 by @federicobond in #2608 - create and re-use
TypeAlias
es andTypeVar
s for "user" and "any user" by @terencehonles in #2384 - Update
django.contrib
for Django 5.2 by @JaeHyuckSa in #2611 - Add stub for
get_select2_language
fromdjango.contrib.admin.widgets
by @michalpokusa in #2612 - Update
django.core.management.commands
for Django 5.2 by @JaeHyuckSa in #2613 - Restrict setuptools to
<79.0.0
forSETUPTOOLS_ENABLE_FEATURES=legacy-editable
to work by @michalpokusa in #2617 - Add EmailMultiAlternatives.body_contains() by @cuu508 in #2618
- Add HttpResponse.text by @cuu508 in #2622
- Allow tuples for some
Options
fields by @ngnpope in #2627 - Add
__all__
by @donBarbos in #2624 - Fix some django 5.2 new missing parameters by @sobolevn in #2629
- [5.2] Improve
django.http.request.MediaType
by @sobolevn in #2631 - [5.2] Fix new errors in
django.http
module by @sobolevn in #2632 - [5.2] Fix
django.template.library
by @sobolevn in #2633 - Update
django.core.serializers
for Django 5.2 by @JaeHyuckSa in #2614 - Update contrib.gis for Django 5.1 by @adamchainz in #2587
- Update some field attributes for Django 5.1 by @adamchainz in #2583
New Contributors
- @stianjensen made their first contribution in #2476
- @PacificGilly made their first contribution in #2509
- @stickperson made their first contribution in #2515
- @zyv made their first contribution in #2524
- @lucemia made their first contribution in #2553
- @Rusich90 made their first contribution in #2564
- @mrgalopes made their first contribution in #2565
- @MaestroXXXVIII made their first contribution in #2576
- @JasonLovesDoggo made their first contribution in #2568
- @simwr872 made their first contribution in #2595
- @michalpokusa made their first contribution in #2612
- @donBarbos made their first contribution in #2624
Full Changelog: 5.1.3...5.2.0