Headline changes
- mypy 1.3.0: Recommended mypy version updated to 1.3.0
- Compatibility: Support for Python 3.7 and Django 4.0 have been dropped.
- New logo: django-stubs has a new logo: https://raw.githubusercontent.com/typeddjango/django-stubs/4.2.1/logo.svg
Django 4.2 additions
- Added support for
db_comment=
argument on Model fields by @andrlik in #1492 - Improve
core.files.storages
types for Django 4.2 by @Alexerson in #1488 - Allow using async
StreamingHttpResponse
by @Alexerson in #1484 - Added
robust
parameter totransaction.on_commit()
by @realsuayip in #1469
Other stubs additions
- Added set/get typing for spatial Model fields by @martinlehoux in #1487
- Made
django.conf
constantsLiteral
s by @sobolevn in #1470 - Added
TypedModelMeta
for typing Model inner Meta class. This feature was deferred from the previous version due to a bug. by @intgr in #1375, #1456
Stubs fixes
- Fixed return types of many decorators (
cache_page
,cache_control
,sensitive_variables
,sensitive_post_parameters
,condition
,etag
,last_modified
) by @Kostia-K in #1465 - Fixed
ManyToManyRawIdWidget
to acceptManyToManyRel
argument by @RyanWalker277 in #1447 - Fixed
classonlymethod
decorator declaration by @adamchainz in #1494 - Fixed type of field attribute descriptors on Model classes (not instance) by @intgr in #1491
- Added missing argument default to
admin.sites.get_app_list()
by @AkaZecik in #1497 - Updated name of
lookup_needs_distinct()
function by @AkaZecik in #1498 - Fixed
_make_token_with_timestamp()
argumentsecret
type by @christianbundy in #1462 - Fixed
send_mass_email()
argument type to allowNone
by @dlesbre in #1516 - Made
UserCreationForm
generic by @monosans in #1518 - Added
SessionBase
methods, improvedSessionStore.get_model_class()
return type by @realsuayip in #1517
Other fixes
Housekeeping
- Added new logo by @adamchainz in #1499, #1500, #1501, #1502
- Dropped Python 3.7 compatibility by @intgr in #1459
- Dropped Django 4.0 compatibility by @intgr in #1468
- Update compatible-mypy & CI to mypy 1.3.0 by @intgr in #1496
- CI: Check and fix missing
__init__.py
with flake8-no-pep420 by @intgr in #1461 - Tweaked package license metadata and rename files by @intgr in #1463
- Version 4.2.1 release (django-stubs, django-stubs-ext) by @intgr in #1520
New Contributors
- @Kostia-K made their first contribution in #1465
- @andrlik made their first contribution in #1492
- @AkaZecik made their first contribution in #1497
- @asottile made their first contribution in #1503
- @Alexerson made their first contribution in #1488
- @dlesbre made their first contribution in #1516
Full Changelog: 4.2.0...4.2.1