What's Changed
- Explicitly type the BaseModelFormSet kwargs by @anderoonies in #3684
- Defer model processing while a type variable bound is unresolved by @wolfgang-aura in #3685
- Don't flag
in_bulk(field_name=...)as an error afterdistinct(field_name)by @juneja-varun in #3638 - Change some
ClassVarto regular attributes by @Lotram in #3695 - Allow
**kwargsintaskdecorator by @novucs in #3700 - Only ban manager access on instances of the manager's own model by @UnknownPlatypus in #3693
- Fix nullability of foreign key id attributes with a default by @oliverhaas in #3694
- Add Python 3.15 support by @UnknownPlatypus in #3705
- Accept
CombinableinField.__set__instead of every field's set type by @UnknownPlatypus in #3709 - Field cleanups pre pep696 by @UnknownPlatypus in #3708
- Move the model field type lookup into the plugin helpers by @UnknownPlatypus in #3711
- Fill generic model type vars with Any where the plugin references a model by @UnknownPlatypus in #3710
- Read model field types through Field descriptors in the plugin by @UnknownPlatypus in #3712
- Remove the redundant
set_auth_user_model_boolean_fieldsattribute hook by @UnknownPlatypus in #3715 - Stop
db_defaultfrom inferring a field's set type by @UnknownPlatypus in #3713 - Type
DistanceResultMixin.source_is_geographyas returningboolby @UnknownPlatypus in #3718 - Type migration graph
Node.childrenandNode.parentsas sets ofNodeby @UnknownPlatypus in #3719 - Accept any sequence of recipients in
send_mass_mailby @UnknownPlatypus in #3720 - Type
Field.db_defaultlike its constructor argument by @UnknownPlatypus in #3721 - Accept a
Mappingof sitemaps in the sitemap views by @UnknownPlatypus in #3724 - Type
strmethods on lazy strings in the stubs instead of the mypy plugin by @UnknownPlatypus in #3717 - Type
FilePathField.pathlike its constructor argument by @UnknownPlatypus in #3722 - Declare
GeneratedField.expressionanddb_persistby @UnknownPlatypus in #3726 - Stop typing
ClientMixin.check_exceptionasNoReturnby @UnknownPlatypus in #3734 - Type
select_templatelikeget_templateby @UnknownPlatypus in #3732 - Type
AnonymousUserDB methods as never returning by @UnknownPlatypus in #3736 - Keep the decorated class type in
decorate_classby @UnknownPlatypus in #3733 - Accept any collection of aliases in
setup_databasesby @UnknownPlatypus in #3723 - Type
BaseFormSet.errorsas a list of form error dicts by @UnknownPlatypus in #3735 - Type
Options.modelas the model class it belongs to by @UnknownPlatypus in #3731 - Accept
Qobjects asIndexexpressions by @UnknownPlatypus in #3730 - Accept lazy strings in
DecimalValidator.messagesandassertRedirectsby @UnknownPlatypus in #3729 - Accept any
BaseFormand no formsets inconstruct_change_messageby @UnknownPlatypus in #3728 - Declare
BaseDatabaseWrapper.rollback_excand the health check attributes by @UnknownPlatypus in #3725 - Give Field type vars an Any default and drop the explicit
[Any, Any]on concrete field references by @UnknownPlatypus in #3714 - Write bare Field instead of Fie
ld[Any, Any]now that its type vars default to Any by @UnknownPlatypus in #3740 - Monkeypatch Django generics in the test settings so test models can subscript them by @UnknownPlatypus in #3744
- Type
get_signed_cookiefrom itsdefaultby @UnknownPlatypus in #3737 - Fix
staff_member_requiredused with arguments by @UnknownPlatypus in #3739 - Type the module-level view decorators as generic functions by @UnknownPlatypus in #3743
- Type
ModelAdmin.save_formandaction_formby @UnknownPlatypus in #3742 - Improve
django.core.management.basetypes by @UnknownPlatypus in #3741 - Move the field yml tests to
assert_typeso every type checker runs them by @UnknownPlatypus in #3746 - Add field regression tests that already pass on master by @UnknownPlatypus in #3750
- Default the
Substr,LeftandRightoutput field to CharField by @UnknownPlatypus in #3749 - More tests for custom fields by @UnknownPlatypus in #3752
- Report deprecations as errors in pyrefly by @UnknownPlatypus in #3754
- Type the templates returned by the form renderers by @UnknownPlatypus in #3755
- Factor the shared Field constructor kwargs into a
FieldInitKwargsTypedDict by @UnknownPlatypus in #3759 - Type admin actions from the
ModelAdminsubclass that defines them by @UnknownPlatypus in #3758 - Accept every
choicesinput on file, related, array and GIS fields by @UnknownPlatypus in #3756 - Fix
BaseDatabaseWrapper.run_on_committype to include the robust flag by @UnknownPlatypus in #3767 - fix: keep TypedDict item modifiers out of get_proper_type by @Omair-Asdaq in #3778
Managerwith genericQuerySetusingTypeVardefaults by @UnknownPlatypus in #2776- Update Ruff configuration to use new style rule code and enable some preview rules by @UnknownPlatypus in #3784
- Raise the minimum supported mypy version to 1.16 by @UnknownPlatypus in #3783
- fix: handle field constructors called through a type variable by @compiler-segfault in #3781
- Defer
from_querysetmanagers until the queryset's type vars are resolved by @UnknownPlatypus in #3782 - Declare
Manager._queryset_classby @UnknownPlatypus in #3786 - Type
QuerySet.__class_getitem__as returning the class by @UnknownPlatypus in #3787 - Test manager access through an unannotated
clsin a model classmethod by @UnknownPlatypus in #3789 - Return a list from
QuerySet.__getitem__when the slice has a step by @UnknownPlatypus in #3788 - Declare a default objects manager on models the app registry can't see by @UnknownPlatypus in #3790
- Remove unused ty and pyrefly ignores on Renovate bumps by @UnknownPlatypus in #3796
- Resolve auto-created models in
apps.get_model()by @compiler-segfault in #3791 - Keep queryset subclass on
.values()/.values_list()by @UnknownPlatypus in #3803 - Fix with annotations runtime by @UnknownPlatypus in #3802
- Add a regression test for fields with a default in
values()rows by @UnknownPlatypus in #3804 - Drop the untyped
BaseGeometryWidget.get_contextoverride by @UnknownPlatypus in #3805 - Annotate the row type var of a generic queryset alongside the model type var by @UnknownPlatypus in #3801
- Type get_next_by_/get_previous_by_ kwargs as object instead of Any by @gregoiredx in #3676
- Expose test client response types in django_stubs_ext by @UnknownPlatypus in #3809
- Accept strings and expressions as bitwise operands of
Combinableby @UnknownPlatypus in #3810 - Type
CompositePrimaryKeyreads as tuples by @UnknownPlatypus in #3811 - Type
GenericRelationas aRelatedManagerof its related model by @UnknownPlatypus in #3806 - Type
assertQuerySetEqual'stransformfrom the iterated items by @UnknownPlatypus in #3738 - Make the
django.contribmanagers generic over their model by @UnknownPlatypus in #3812 - Accept any collection of schemes in
URLValidatorby @UnknownPlatypus in #3815 - Accept module urlconfs and any ASGI app, type
sequence_reset_sqlaslist[str]by @UnknownPlatypus in #3814 - Reuse typeshed
SupportsWrite,StrPathandWSGIEnvironmentinstead of local types by @UnknownPlatypus in #3816 - Document annotating migration
appsasStateAppsin the FAQ by @UnknownPlatypus in #3817 - Merge the
Model(),create()andacreate()argument hooks into one by @UnknownPlatypus in #3818 - Call
reparametrize_generic_classdirectly instead of through three wrapper hooks by @UnknownPlatypus in #3820 - Merge the reverse foreign key and many-to-many related manager hooks into one by @UnknownPlatypus in #3822
- Move the manager type hook to managers.py and generic reparametrization to generics.py by @UnknownPlatypus in #3823
- Improve
redirectandresolve_urlshortcuts by @ngnpope in #3824 - Share the annotated queryset row handling between
annotate,prefetch_relatedand custom annotated methods by @UnknownPlatypus in #3828 - Improve install section for other type checkers by @sobolevn in #3832
- Read annotations carried only by the queryset row as part of its model, so every queryset method sees them by @UnknownPlatypus in #3831
- Resolve field nullability at the call site with
__init__overloads by @UnknownPlatypus in #3763 - Add
Model._is_pk_set()by @hongquan in #3840 - Accept a field by its name in model init when its attname differs by @oliverhaas in #3687
- Fix pyrefly 1.5.0
bad-overrideerrors inassert_typetests by @UnknownPlatypus in #3851 - Fix
HttpRequest.multipart_parser_classby @sobolevn in #3850 - Make
_IndexableCollection.__getitem__positional-only by @UnknownPlatypus in #3852 - Add agents md by @UnknownPlatypus in #3856
- Resolve FK using
__init__overloads by @UnknownPlatypus in #3844 - Fix django.utils.translation.get_language() may return None by @ddanier in #3858
- Keep checking the other
filter()lookups after a queryset-valued one by @UnknownPlatypus in #3862 - Add
__init__overloads to more builtin django fields by @UnknownPlatypus in #3857 - Type aggregate output_field and default, and require expressions in annotate() by @dhruvparanjape in #3859
- Update the DRF-like queryset holder in manager access tests by @UnknownPlatypus in #3865
- Fix
ip_address_validatorsreturn type to a list of validators by @emmanuel-ferdman in #3870 - Type
django.utils.datesvalues as lazy strings by @emmanuel-ferdman in #3872 - Use
builtinstypes where a class member shadows them by @UnknownPlatypus in #3874 - Restore
CharField.db_collationclass attribute by @UnknownPlatypus in #3873 - Type
ResolverMatch.argsandkwargsas the tuple and dict resolvers build by @UnknownPlatypus in #3875 - Accept
Nonewhen writing an auto primary key by @PhillipChaffee in #3878 - Remove the plugin's
AutoFieldspecial case for setting null by @PhillipChaffee in #3881 - Type file fields as their stored name in
values()andvalues_list()by @UnknownPlatypus in #3876 - Check the tests with ty's Django support enabled by @UnknownPlatypus in #3883
- Keep the response type in
conditional_content_removaland the value type inHttpHeaders.to_wsgi_namesby @UnknownPlatypus in #3884 - Accept lazy names and field lists in contrib
Metaclasses by @emmanuel-ferdman in #3887 - Type
call_commandas returningstr | None, orstrfor built-in commands that always output by @UnknownPlatypus in #3885 - Remove unsupported choices argument from FilePathField by @arod19 in #3891
- Test that only concrete children of an abstract model get an automatic
idby @UnknownPlatypus in #3894 - Allow Path in template engine dirs and template_dirs by @arod19 in #3890
New Contributors
- @anderoonies made their first contribution in #3684
- @wolfgang-aura made their first contribution in #3685
- @sobolevn with @Copilot made their first contribution in #3691
- @juneja-varun made their first contribution in #3638
- @novucs made their first contribution in #3700
- @oliverhaas made their first contribution in #3694
- @Omair-Asdaq made their first contribution in #3778
- @compiler-segfault made their first contribution in #3781
- @gregoiredx made their first contribution in #3676
- @hongquan made their first contribution in #3840
- @ddanier made their first contribution in #3858
- @dhruvparanjape made their first contribution in #3859
- @PhillipChaffee made their first contribution in #3878
- @arod19 made their first contribution in #3891
Full Changelog: 6.1.2...6.1.3