NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
PyPI · #1083 most downloaded on PyPI
Monkey-patching and extensions for django-stubs
Last release 20 days ago
14 Sep 2026
Ships fairly regularly
a new release about every 3 weeks
Nearly every release is documented
notes for 41 of 43 stable releases
Nothing withdrawn
no release was ever pulled
6 years old
44 releases · first in 2020
One column per quarter.
This release does some changes around Manager / RelatedManager and the auto generated objects attribute to work better with typechecker like pyright /
This release does some changes around Manager / RelatedManager and the auto generated objects attribute to work better with typechecker like pyright / ty / pyrefly and be more strict about the fact that MyModel().objects is not valid.
However, to support that, existing broad annotations of related managers need to be narrowed or access to these related managers will be flagged as an error. For ex:
from django.db import models
from django_stubs_ext.db.models.manager import ManyRelatedManager, RelatedManager
class Article(models.Model):
- category_set: Manager[Category]
+ category_set: RelatedManager[Category]
- tags: Manager[Tag, ArticleTag]
+ tags: ManyRelatedManager[Tag, ArticleTag]If you use the mypy plugin, you should also be able to drop these annotation completely in most cases. The plugin infers these types automatically.
See https://github.com/typeddjango/django-stubs#do-i-need-to-annotate-reverse-relations
FileField.save_form_data by @brianhelba in #3606None passed to FileField.generate_filename by @brianhelba in #3607assertTemplateUsed and assertTemplateNotUsed by @brianhelba in #3564setter in hashers.check_password better by @Kakadus in #3621AbstractBaseUser.natural_key return type by @Kakadus in #3622@admin.display overload to specify function by @ngnpope in #3620_meta.get_field() when the model is defined later in the module by @federicobond in #3489process_lhs to CaseInsensitiveMixin stub by @UnknownPlatypus in #3552Full Changelog: 6.1.0...6.1.1
This is the first Django 6.1 release 🎉
This is the first Django 6.1 release 🎉
Django 6.0 and 5.2 are now in partial support mode.
Django 5.1 and 5.0 support was dropped (techically they would still work, but we don't test them no more).
Python 3.10 support was dropped.
Feedback is very welcome! 👍
Full Changelog: 6.0.9...6.1.0
6.0.8 was supposed to be the last 6.0.x release, but we found several regressions that we wanted to fix. Now we are working on 6.1.0 release :)
6.0.8 was supposed to be the last 6.0.x release, but we found several regressions that we wanted to fix.
Now we are working on 6.1.0 release :)
Full Changelog: 6.0.8...6.0.9
This is the last release with Django 6.0 full support. The next release will be focused on Django 6.1 support with Django 6.0 partial support.
This is the last release with Django 6.0 full support.
The next release will be focused on Django 6.1 support with Django 6.0 partial support.
contrib.gis by @UnknownPlatypus in #3500objects / _default_manager attributes by @UnknownPlatypus in #3499find_member by @UnknownPlatypus in #3501db.models, core and migrations by @UnknownPlatypus in #3504core, apps, urls and admindocs by @UnknownPlatypus in #3503forms and improve types of lazy regexes by @01xnikhil in #3293django.tasks by @UnknownPlatypus in #3512apps.get_model() by @UnknownPlatypus in #3511settings.INSTALLED_APPS change and cache full config computation by @UnknownPlatypus in #3514utils and templates by @UnknownPlatypus in #3513lookup_fully_qualified instead of custom symbol lookup by @UnknownPlatypus in #3519has_base instead of a metadata registry by @UnknownPlatypus in #3520Field's by @UnknownPlatypus in #3522LogEntry, FlatPage and Redirect as assignments by @UnknownPlatypus in #3524distinct / update / in_bulk by @UnknownPlatypus in #3168View, TemplateView, and TemplateResponseMixin generic on response type by @samueljsb in #2874HttpRequest by @bigfootjon in #2239TemplateView opt-in by @UnknownPlatypus in #3543pyrefly / pyright / ty basic support by @sobolevn in #3562Full Changelog: 6.0.7...6.0.8
Fix manager resolution when QuerySet overrides as_manager by @federicobond in #3460
Field.formfield keyword args by @brianhelba in #3443Full Changelog: 6.0.6...6.0.7
Fix task decorator typing for takes_context=True by @federicobond in #3406
task decorator typing for takes_context=True by @federicobond in #3406validators consistent by @brianhelba in #3433Full Changelog: 6.0.5...6.0.6
Accept datetime/timedelta on reverse ops of Combinable by @federicobond in #3361
.annotate() is called on a generic QuerySet by @federicobond in #3379__in lookup by @ngnpope in #3314pyrefly to 1.0.0 by @sobolevn in #3386related_model type for mypy 2.1 by @UnknownPlatypus in #3388empty-body error code for mypy and ty by @ngnpope in #3390mark_safe to accept StrOrPromise by @Alexerson in #3392unused-ignore code in pyrefly by @UnknownPlatypus in #3393AdminSite.register typing by @noamkush in #3387Full Changelog: 6.0.4...6.0.5
Add more test field nullable by @UnknownPlatypus in #3325
mypy@2.0 support is added.
RedisCache._cache by @sobolevn in #3337analyze_member_access helper into helpers module by @UnknownPlatypus in #3339defaults and create_defaults dict literals by @federicobond in #3326finders.find(all=...) by @UnknownPlatypus in #3352EmailMessage.message() return as stdlib email.message.EmailMessage by @ahmedasar00 in #3291str/Combinable for Aggregate.order_by by @federicobond in #3357__init__ stubs by @federicobond in #3359**flags with explicit kwargs on Library.filter by @federicobond in #3360default_alias for positional Aggregate in annotate() by @federicobond in #3362Full Changelog: 6.0.3...6.0.4
Remove patching of reveal_type() and reveal_locals() by @ngnpope in #3255
reveal_type() and reveal_locals() by @ngnpope in #3255.values_list() field types on annotated querysets by @federicobond in #3253__eq__ to CaseInsensitiveMapping by @hauntsaninja in #3256TypedDictType directly when merging typeddict by @UnknownPlatypus in #3262databases type in SimpleTestCase to use Literal["__all__"] by @ahmedasar00 in #3264.annotate(...) on custom bound QuerySet by @UnknownPlatypus in #3271ignoreDeps to prevent Renovate from updating Python versions by @UnknownPlatypus in #3280WithAnnotations through custom QuerySet methods by @UnknownPlatypus in #3266build_q_object_from_lookup_parameters parameter type by @alessio-b2c2 in #3277ListFilter.used_parameters and params types in admin filter stubs by @alessio-b2c2 in #3187__deepcopy__ return type by @ahmedasar00 in #3275names arg to Query.names_to_path to Sequence[str] by @joshuadavidthomas in #3285(a)get_or_create and (a)update_or_create kwargs by @federicobond in #3309Full Changelog: 6.0.2...6.0.3
We now officially support mypy@1.20 . Since this release we run ty over our test cases.
We now officially support mypy@1.20.
Since this release we run ty over our test cases.
swappable parameter to ForeignKey and OneToOneField by @emmanuel-ferdman in #3204backend attribute stub for authenticated users by @emmanuel-ferdman in #3210in operator false positive with union types by @emmanuel-ferdman in #3206DJANGO_SETTINGS_MODULE is set by @emmanuel-ferdman in #3223NestedObjects.nested return type to list[Any] by @emmanuel-ferdman in #3226Model instead of Self in parms and add AltersData inheritance by @emmanuel-ferdman in #3228django_stubs_ext by @UnknownPlatypus in #3237boolean and empty_value in admin display decorator by @UnknownPlatypus in #3242field.attname with fallback to field.name by @UnknownPlatypus in #3248.values() field types on annotated querysets by @federicobond in #3232Full Changelog: 6.0.1...6.0.2
Fix serve() return type to include HttpResponse by @emmanuel-ferdman in #3199
serve() return type to include HttpResponse by @emmanuel-ferdman in #3199Meta class stubs for auth and session models by @emmanuel-ferdman in #3200.order_by validation for abstract models by @UnknownPlatypus in #3197Full Changelog: 6.0.0...6.0.1
Update deprecation module by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/3013
This version add stubs coverage to all known Django 6.0 functionality. If you find anything missing, please open an issue.
Besides Django 6.0 updates, there is an even larger number of other improvements.
Many thanks to everyone who helped out, the amount of contributions has been amazing!
There is a crash bug in the mypy plugin, when checking code that uses QuerySet.order_by() with abstract models. Please follow https://github.com/typeddjango/django-stubs/issues/3184
databases= parameter to check_generic_foreign_keys, check_model_name_lengths by @Tosinibikunle in https://github.com/typeddjango/django-stubs/pull/2951__del__ methods by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2974SetPasswordMixin.__class_getitem__ by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2985main/django/contrib/auth/admin.py by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2986Form in DeleteView type parameters by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/2996FileField and ImageField instance access return types by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/2997SessionBase dict method signatures by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/3020LimitedStream stub signatures by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/3022IO[bytes] with _PostDataProtocol to fix HttpRequest compatibility by @Skyiesac in https://github.com/typeddjango/django-stubs/pull/3167ResponseHeaders can take any mapping, not just dict by @sobolevn in https://github.com/typeddjango/django-stubs/pull/3014formfield_callback to return None by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/3021response_gone_class by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/3061get_violation_error_message to return dictionaries by @meunomemauricio in https://github.com/typeddjango/django-stubs/pull/3065Subquery and Exists to accept subquery inputs by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/3103AdminSeleniumTestCase.assertCountSeleniumElements by @DeXtAr47-oss in https://github.com/typeddjango/django-stubs/pull/3117BaseDatabaseFeatures.rounds_to_even by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/3128django.db.models.fields.tuple_lookups module by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/3131ForeignKey.cast_db_type method by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/3126BaseDatabaseFeatures.supports_tuple_lookups by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/3129Q.identity cached_property by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/3127BaseDatabaseSchemaEditor.sql_pk_constraint by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/3130MySQLGISSchemaEditor.__init__ by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/3139django.utils.datastructures.ImmutableList by @ngnpope in https://github.com/typeddjango/django-stubs/pull/3155django.db.models.expressions.Window by @ngnpope in https://github.com/typeddjango/django-stubs/pull/3170value_to_string return types for JSONField and RangeField by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/3188allowed_default in expression classes by @ahmedasar00 in https://github.com/typeddjango/django-stubs/pull/3186NotUpdated exception by @ngnpope in https://github.com/typeddjango/django-stubs/pull/3046Prefetch + to_attr and multiple levels by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/3151update_fields and unique_fields of bulk_create by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/3150earliest / latest / orderby by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/3158only / defer by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/3165_PropertyDescriptor usage in response.pyi by @sobolevn in https://github.com/typeddjango/django-stubs/pull/3086django.utils.inspect stubtest errors on Python 3.14+ by @ngnpope in https://github.com/typeddjango/django-stubs/pull/3152explicit-override and --disallow-subclassing-any by @ngnpope in https://github.com/typeddjango/django-stubs/pull/3172django-modern-rest to the README by @sobolevn in https://github.com/typeddjango/django-stubs/pull/3183Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.9...6.0.0
Version 5.2.9 will be the last version to target Django 5.2 -- the next version will be updating to 6.0!
Version 5.2.9 will be the last version to target Django 5.2 -- the next version will be updating to 6.0!
Many new Django 6.0 APIs are still missing stubs coverage, and changes to existing APIs are not covered. If you are interested in contributing, please help by opening PRs (check that a PR does not exist already for your topic).
And by the way, we are still missing some things from previous Django versions too! Check earlier release note, other allowlist_todo*.txt files and https://github.com/typeddjango/django-stubs/issues/1493#issuecomment-2105730206
If want to help but you are not sure how to implement something in stubs:
EmailMultiAlternatives in outbox by @alexei in https://github.com/typeddjango/django-stubs/pull/2922get_auto_imports() to also allow returning None by @jamesbeith in https://github.com/typeddjango/django-stubs/pull/2956prefetch_related_objects requires Sequence not Iterable by @emmanuel-ferdman in https://github.com/typeddjango/django-stubs/pull/2970forms.widgets.Script by @brianhelba in https://github.com/typeddjango/django-stubs/pull/2973list, not a Sequence by @brianhelba in https://github.com/typeddjango/django-stubs/pull/2992Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.8...5.2.9
Run tests against the lowest supported django version by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2862
django.shortcuts.resolve_url to receive a str-promise by @alexei in https://github.com/typeddjango/django-stubs/pull/2869str from enum label types when we know for sure the labels are lazy by @rchen152 in https://github.com/typeddjango/django-stubs/pull/2888Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.7...5.2.8
Fixes a regression in django-stubs version 5.2.6:
Fixes a regression in django-stubs version 5.2.6:
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.6...5.2.7
Fix the log_action deprecation notice by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2839
add_ordering signature too by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2822related_query_name in Model._meta.get_fields by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2821strict_model_abstract_attrs setting to allow models.Model.objects access by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2830_replace_type_var that can potentially cause cache problems by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2834union / intersection / difference to support QuerySet using values_list and values by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2829log_action deprecation notice by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2839.values/.values_list calls by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2836GenericPrefetch by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2851aget calls by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2856fields argument to bulk_update by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2808mypy_primer workflow by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2819django.contrib.contenttypes installed app in tests by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2853pyproject.toml by @intgr in https://github.com/typeddjango/django-stubs/pull/2847ruff to 0.13.0 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2828uv package manageruv by @intgr in https://github.com/typeddjango/django-stubs/pull/2846uv_build build system & cleanup by @intgr in https://github.com/typeddjango/django-stubs/pull/2848uv workspace for django-stubs-ext also by @intgr in https://github.com/typeddjango/django-stubs/pull/2857Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.5...5.2.6
Testing updated release workflow.
Testing updated release workflow.
Using alpha version in case anything goes wrong -- so users won't be updated automatically.
Fix regression that some places do not accept _StrPromise returned by reverse_lazy by @sobolevn in https://github.com/typeddjango/django-stubs/pull/28
_StrPromise returned by reverse_lazy by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2814.order_by to accept any Combinable by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2816Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.4...5.2.5
Fix TestClient.get regression by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2812
TestClient.get regression by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2812Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.3...5.2.4
Refine Model._meta.get_field("field_name") type inference by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2748
Model._meta.get_field("field_name") type inference by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2748__init__ calls by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2749settings.TEMPLATE types by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2741content_type_extra contains bytes, not str by @alexmv in https://github.com/typeddjango/django-stubs/pull/2754reverse_lazy() by @pgcd in https://github.com/typeddjango/django-stubs/pull/2766FormMixin.success_url to _StrOrPromise by @pgcd in https://github.com/typeddjango/django-stubs/pull/2769BaseForm.add_error() in documentation by @CarrotManMatt in https://github.com/typeddjango/django-stubs/pull/2774OrderedDict usage, this is the default since py 3.6 by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2780get_current_module util by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2781to_attr inferrence in Prefetch calls by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2779get_class_init_argument_by_name in resolve_many_to_many_arguments by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2782Model inference from custom QuerySet/Manager by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2784Prefetch as generic and do specialization in the plugin by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2786Meta.permissions type by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2787prefetch_related calls by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2789TypedModelMeta by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2788.select_related stubs by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2792.prefetch_related(..., to_attr="foo") conflict with .annotate(foo=...) by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2791to_attr target (alredy defined fields) by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2794order_by / defer / only / distinct / order_by / explain / dates / datetimes by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2795prefetch_related types with an overload by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2793to_attr targets by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2797select_related lookups by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2806Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.2...5.2.3
Fix reveal_type to return its argument by @andersk in https://github.com/typeddjango/django-stubs/pull/2716
reveal_type to return its argument by @andersk in https://github.com/typeddjango/django-stubs/pull/2716RawQuerySet by @youtux in https://github.com/typeddjango/django-stubs/pull/2718join to JSONObject by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2721QuerySet._raw_delete by @asottile in https://github.com/typeddjango/django-stubs/pull/2733resolve_callables argument type to Mapping by @rodmk in https://github.com/typeddjango/django-stubs/pull/2735HttpResponse.context_data by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2737django.contrib.auth.forms by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2738.values() types when expressions are used by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2739BasePasswordHasher.safe_summary commonly uses StrOrPromise by @jdelic in https://github.com/typeddjango/django-stubs/pull/2742FormMixin plugin by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2746Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.1...5.2.2
Fix some is not present at runtime errors by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2635
<type> is not present at runtime errors by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2635BaseManager to Manager to follow runtime behavior by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2637django.template.autoreload by @rafailmdzdv in https://github.com/typeddjango/django-stubs/pull/2638_UserType by @asottile in https://github.com/typeddjango/django-stubs/pull/2645.value of a Choices variable by @asottile in https://github.com/typeddjango/django-stubs/pull/2644null keyword argument to ManyToManyField init by @lev-blit in https://github.com/typeddjango/django-stubs/pull/2648settings.AUTH_PASSWORD_VALIDATORS by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2652django.http errors by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2654mysqlclient deps to reveal mysql module stubtest errors by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2656django.core.handlers by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2660MediaDefiningClass by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2662uv to manage dev dependencies by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2698django.db.models.expressions.Expression.identity by @cjwatson in https://github.com/typeddjango/django-stubs/pull/2685assertFormError form arg type to BaseForm by @marxide in https://github.com/typeddjango/django-stubs/pull/2705LogEntryManager.log_actions by @youtux in https://github.com/typeddjango/django-stubs/pull/2710Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.2.0...5.2.1
We now support Django@5.2 LTS release!
mypy --strict modemypy version is updated to 1.13format_lazy typing by @ashm-dev in https://github.com/typeddjango/django-stubs/pull/2504_Choices type by @stianjensen in https://github.com/typeddjango/django-stubs/pull/2476context_data attribute to _MonkeyPatchedW/ASGIResponse. by @PacificGilly in https://github.com/typeddjango/django-stubs/pull/2509type[Model] does not have objects attribute" by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2519db.migrations.operations by @Viicos in https://github.com/typeddjango/django-stubs/pull/2349select_format() methods by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2525django.conf.urls by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2528Func.function by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2529ClassVar annotations on mutable ModelAdmin types for ruff by @zyv in https://github.com/typeddjango/django-stubs/pull/2524ClassVar annotations on Migration class attributes by @zyv in https://github.com/typeddjango/django-stubs/pull/2530Model.[a]save() signature change by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2535@contextmanager by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2561_Choices type for forms by @mrgalopes in https://github.com/typeddjango/django-stubs/pull/2565is_postgresql_* properties for Django 5.1 by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2566db_table_comment to model meta by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2571BaseModelAdmin.get_inlines() return type by @MaestroXXXVIII in https://github.com/typeddjango/django-stubs/pull/2576flatten and flatten_fieldsets by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2572__slotnames__ by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2584TypedModelMeta fields by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2594django.contrib.gis.geoip2 stubs by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2593django.core.validators for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2598django.test.client and django.utils for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2599django.contrib.auth.backends for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2600django.contrib.auth.models for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2601MutableMapping for Form.Initial by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/2604django.contrib.admin for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2607django.db.models.sql for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2606django.forms.widgets for Django 5.2 by @federicobond in https://github.com/typeddjango/django-stubs/pull/2608TypeAliases and TypeVars for "user" and "any user" by @terencehonles in https://github.com/typeddjango/django-stubs/pull/2384django.contrib for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2611get_select2_language from django.contrib.admin.widgets by @michalpokusa in https://github.com/typeddjango/django-stubs/pull/2612django.core.management.commands for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2613<79.0.0 for SETUPTOOLS_ENABLE_FEATURES=legacy-editable to work by @michalpokusa in https://github.com/typeddjango/django-stubs/pull/2617Options fields by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2627__all__ by @donBarbos in https://github.com/typeddjango/django-stubs/pull/2624django.http.request.MediaType by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2631django.http module by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2632django.template.library by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2633django.core.serializers for Django 5.2 by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2614Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.1.3...5.2.0
Fix @deprecated based on the review by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2485
ContentType model fields to be infered as Any, refs #2446 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2483@deprecated based on the review by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2485null=True and Any type param for Field types by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2492TestCase.assertJSON{Not,}Equal by @nickstenning in https://github.com/typeddjango/django-stubs/pull/2497Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.1.2...5.1.3
Add deprecated decorators for multiple classes and methods by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2458
.values_list returns incorrect type for field with same name when selected from related model by @Niicck in https://github.com/typeddjango/django-stubs/pull/2431ModelAdmin.construct_change_message by @youtux in https://github.com/typeddjango/django-stubs/pull/2444contrib.admin.options.ModelAdmin by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2422contrib.gis.gdal.geometries by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2460contrib.admin.models.LogEntryManager by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2423Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.1.1...5.1.2
Add django 5.1 to the test matrix and add its classifier by @foarsitter in https://github.com/typeddjango/django-stubs/pull/2380
BaseEngine.app_dirname non-optional by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2394(a)refresh_from_db() by @jacobtylerwalls in https://github.com/typeddjango/django-stubs/pull/2402from_string() and get_template() return backend-specific template by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2400get_session_auth_fallback_hash method to the correct type by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2407QuerySet.alias like QuerySet.annotate by @andersk in https://github.com/typeddjango/django-stubs/pull/2411db.migrations.serializer by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2421django.conf.global_settings by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2420None on view_on_site by @nijel in https://github.com/typeddjango/django-stubs/pull/2419Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.1.0...5.1.1
5.1: Deprecate CheckConstraint.check by @q0w in https://github.com/typeddjango/django-stubs/pull/2331
annotate to utilise mypy.types.Instance.extra_attrs by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2319AUTH_USER_MODEL with a get_type_analyze_hook by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2335SimpleTestCase by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2289fields being an Iterable in bulk_update by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2296from_queryset manager as reverse manager by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2295--strict on assert_type tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2301get_context_object_name on SingleObjectMixin and MultipleObjectMixin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2298BaseManager.cache attribute by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2309CurrentSiteManager manager type var by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2308django-stubs-ext by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2310Any for ConnectionProxy attributes by @RealOrangeOne in https://github.com/typeddjango/django-stubs/pull/2311FieldDoesNotExist from where it's not present at runtime by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2313ManyToManyField.description a _StrOrPromise by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2312models.Model adjustments from get_metaclass_hook by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2322stubdefaulter by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2326stubdefaulter by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2327tuple[A] types to be tuple[A, ...] types by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2328<QuerySet>.filter call by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2332mypy.plugins.proper_plugin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2333make_optional_type instead of shipping our own by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2334utils by @Viicos in https://github.com/typeddjango/django-stubs/pull/2352contrib.sessions.backends by @Viicos in https://github.com/typeddjango/django-stubs/pull/2351.annotate fields by @sterliakov in https://github.com/typeddjango/django-stubs/pull/2376QuerySet.as_manager() by @sterliakov in https://github.com/typeddjango/django-stubs/pull/2377Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.4...5.1.0
This is a re-release of django-stubs 5.0.3 with a minor fix:
This is a re-release of django-stubs 5.0.3 with a minor fix:
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.3...5.0.4
django-stubs-ext before django-stubs by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2188apps/test_config.yml 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2190ManyToManyField.m2m_field_name and Model._get_pk_val methods by @YPCrumble in https://github.com/typeddjango/django-stubs/pull/2177Lookup should be a subtype of Expression by @mkurnikov in https://github.com/typeddjango/django-stubs/pull/2199django.db.models.functions: allow Combinable as parameter, add Round function by @noamkush in https://github.com/typeddjango/django-stubs/pull/2195django.core.management.utils functions by @Viicos in https://github.com/typeddjango/django-stubs/pull/2200django.middleware stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2202django.http stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2201db/models/test_constraints.yml to 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2204display and action decorators by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2210django.forms.ChoiceWidget by @asottile in https://github.com/typeddjango/django-stubs/pull/2207ReverseManyToOneDescriptor generic over a model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2227QuerySet for multiple defaults in MultipleObjectMixin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2191objects annotation by @asottile in https://github.com/typeddjango/django-stubs/pull/2241serialized_aliases parameter to setup_databases function in django.test.utils by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2247ConnectionProxy by @Viicos in https://github.com/typeddjango/django-stubs/pull/2246get_template_tag_modules function signature to django.template.backends.django by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2250django.db.models.sql.Query class by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2253admin.sites._ViewType bound to allow StreamingHttpResponse by @savanto in https://github.com/typeddjango/django-stubs/pull/2256Options._get_fields by @Viicos in https://github.com/typeddjango/django-stubs/pull/2254Path type argument to tuple returned by get_app_template_dirs by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2266Paginator by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2271ManyToManyField by @flaeppe in https://github.com/typeddjango/django-stubs/pull/22755.0.3 by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2274Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.2...5.0.3
Release workflow: publish django-stubs-ext before django-stubs by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2188
django-stubs-ext before django-stubs by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2188apps/test_config.yml 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2190ManyToManyField.m2m_field_name and Model._get_pk_val methods by @YPCrumble in https://github.com/typeddjango/django-stubs/pull/2177Lookup should be a subtype of Expression by @mkurnikov in https://github.com/typeddjango/django-stubs/pull/2199django.db.models.functions: allow Combinable as parameter, add Round function by @noamkush in https://github.com/typeddjango/django-stubs/pull/2195django.core.management.utils functions by @Viicos in https://github.com/typeddjango/django-stubs/pull/2200django.middleware stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2202django.http stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2201db/models/test_constraints.yml to 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2204display and action decorators by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2210django.forms.ChoiceWidget by @asottile in https://github.com/typeddjango/django-stubs/pull/2207ReverseManyToOneDescriptor generic over a model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2227QuerySet for multiple defaults in MultipleObjectMixin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2191objects annotation by @asottile in https://github.com/typeddjango/django-stubs/pull/2241serialized_aliases parameter to setup_databases function in django.test.utils by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2247ConnectionProxy by @Viicos in https://github.com/typeddjango/django-stubs/pull/2246get_template_tag_modules function signature to django.template.backends.django by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2250django.db.models.sql.Query class by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2253admin.sites._ViewType bound to allow StreamingHttpResponse by @savanto in https://github.com/typeddjango/django-stubs/pull/2256Options._get_fields by @Viicos in https://github.com/typeddjango/django-stubs/pull/2254Path type argument to tuple returned by get_app_template_dirs by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2266Paginator by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2271ManyToManyField by @flaeppe in https://github.com/typeddjango/django-stubs/pull/22755.0.3 by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2274Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.2...5.0.3
This is a re-release of django-stubs 5.0.1 with a minor fix:
This is a re-release of django-stubs 5.0.1 with a minor fix:
django-stubs-ext dependency to 5.0.2 by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2186Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.1...5.0.2
Support for Django 4.1 have been dropped by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2133
A new extra, django-stubs[oracle], was added by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2131
Remove QuerySet alias hacks via PEP 696 TypeVar defaults. All usages of QuerySetAny and ValuesQuerySet can now be replaced with simple QuerySet by @intgr in https://github.com/typeddjango/django-stubs/pull/2104
django.contrib.admin.views and django.forms.forms.Form metaclass by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2079django.db.models.lookups by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2103django.db.backends.utils by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2102django.forms.field.Field by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2107django.contrib.messages.storage.cookie by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2106django.db.models.expressions by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2110django.contrib.auth.backends by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2111django.contrib.auth.base_user by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2113django.db.migrations.serializer by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2109django.db.backends.base.features.BaseDatabaseFeature by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2099django.db.backends.base.operations.BaseDatabaseOperations by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2100request.auser by @bshelkhonov in https://github.com/typeddjango/django-stubs/pull/2108django.contrib.gis.admin.widgets and django.contrib.gis.admin.options by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2116django.forms.boundfield and django.forms.utils by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2118BaseBackend.get_user: Relax user_id param type by @tony in https://github.com/typeddjango/django-stubs/pull/2121django.forms.renderers by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2119django.forms.forms by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2122django.contrib.gis.db.backends.sqatialite.schema by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2123schema modules by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2124django.contrib.messages.test by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2126django.contrib.contenttypes.prefetch by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2115django.contrib.admin.widgets by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2105django.contrib.contenttypes.fields.GenericForeignKey methods by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2137backend in django.contrib.auth (ModelBackend -> BaseBackend) by @tony in https://github.com/typeddjango/django-stubs/pull/2141Query.resolve_lookup_value() parameters by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2136django.forms.models by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2146django.db.migrations.autodetector by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2149django.db.models.enums by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2148django.forms.widgets by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2147django-stubs-ext by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2150django.db.models.field.related by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2151TextChoices.__new__() parameter type by @mvaled in https://github.com/typeddjango/django-stubs/pull/2156django.contrib.gis.db.backends.postgis.operations by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2138django.db.models.fields.reverse_related by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2158django.db.models.field: add generated attribute to model fields by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2152django.db.models.sql.datastructures by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2159django.db.models.query by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2160django.db.models.sql.compiler by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2166django.db.models.functions.datetime by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2167django.forms.formsets by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2145django.db.models.query_utils by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2165django.db.models.functions.datetime.Now by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2173django.db.models.sql.query.Query by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2172django.db.models.field.related_descriptors by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2157django.db.models.expressions by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2176BaseConstraint.get_violation_error_message() by @q0w in https://github.com/typeddjango/django-stubs/pull/2178assert_type test cases, run pyright by @Viicos in https://github.com/typeddjango/django-stubs/pull/2162AbstractBaseSession: Use model fields for subclassed cases by @tony in https://github.com/typeddjango/django-stubs/pull/21805.0.1 by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2183Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.0...5.0.1
Remove some deprecated Django 3.x APIs by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1991
QuerySet class no longer derives from Collection. If you run into errors like incompatible type "_QuerySet[User, User]"; expected "Collection[User]", please read this announcement.Collection base class and __contains__ method from QuerySet by @fidoriel in https://github.com/typeddjango/django-stubs/pull/1925ManyRelatedManager.through attribute and generic type parameter by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2026StrPromise not inherit from Sequence[str] by @intgr in https://github.com/typeddjango/django-stubs/pull/1841AppConfig.models_module by @Viicos in https://github.com/typeddjango/django-stubs/pull/1866None in settings MIGRATION_MODULES dict values by @asottile in https://github.com/typeddjango/django-stubs/pull/1871JSONField.from_db_value by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1879converters in urls.resolvers by @Viicos in https://github.com/typeddjango/django-stubs/pull/1892@type_check_only to all Protocols and known stubs-only classes by @intgr in https://github.com/typeddjango/django-stubs/pull/1894ModuleType as a possible type to URLResolver.urlconf_name by @Viicos in https://github.com/typeddjango/django-stubs/pull/1891URLPattern.default_args by @Viicos in https://github.com/typeddjango/django-stubs/pull/1895PYI046 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1907EmailBackend.ssl_keyfile and EmailBackend.ssl_certfile by @Viicos in https://github.com/typeddjango/django-stubs/pull/1911django.VERSION by @Viicos in https://github.com/typeddjango/django-stubs/pull/1916CommandParser to commands.__init__ by @jamesbraza in https://github.com/typeddjango/django-stubs/pull/1927assume_scheme to forms.URLField by @asottile in https://github.com/typeddjango/django-stubs/pull/1929BaseModelAdmin.formfield_for_dbfield by @Viicos in https://github.com/typeddjango/django-stubs/pull/1934pre-commit==3.6.1 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1936Response.set_cookie.max_age by @Viicos in https://github.com/typeddjango/django-stubs/pull/1941core.signing by @Viicos in https://github.com/typeddjango/django-stubs/pull/1945core.validators by @Viicos in https://github.com/typeddjango/django-stubs/pull/1947core.paginator by @Viicos in https://github.com/typeddjango/django-stubs/pull/1946forms.ModelChoiceField by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1889set in model_to_dict's exclude by @jamesbraza in https://github.com/typeddjango/django-stubs/pull/1952BaseEngine.template_dirs by @Viicos in https://github.com/typeddjango/django-stubs/pull/1954extra_context on TemplateViews by @samueljsb in https://github.com/typeddjango/django-stubs/pull/1994pytest-mypy-plugins to 3.1.1 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2003django.contrib.auth by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2009django.conf by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2008django.views by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2007django.test by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2005django.utils by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2006stubtest by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2015Q methods: check(), flatten() by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1899utils.termcolors by @Viicos in https://github.com/typeddjango/django-stubs/pull/1901PRI_MYPY in get_additional_deps hook by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2024_default_manager and _base_manager to be Manager by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2022django.contrib.admin by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2004core.files by @Viicos in https://github.com/typeddjango/django-stubs/pull/1949core.cache.backends, add RedisCache and related classes by @Viicos in https://github.com/typeddjango/django-stubs/pull/1948AsyncClient.defaults attribute typing by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1878fields argument of Model.refresh_from_db() by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2035AdminSite.get_model_admin generic by @Viicos in https://github.com/typeddjango/django-stubs/pull/2038db_default= parameter to models Field classes by @Skorpyon in https://github.com/typeddjango/django-stubs/pull/1876class Meta from Model and Form class stubs by @jorenham in https://github.com/typeddjango/django-stubs/pull/2000ManyToOneRel.get_accessor_name() by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2052DeferredAttribute.__get__() by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2050FieldFile by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2051db_comment= parameter to Postgres and GIS model fields by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2054db.models.sql.query.Query.join() argument by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2055django.db.backends.oracle.base by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2057django.test.client by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2059django.test.html by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2060django.test.runner by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2061django.template, django.templatetags by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2063django.test.testcases by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2062django.http by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2064django.core.management by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2067django.core.handlers by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2066django.contrib.sessions.serializers, django.core.serializers by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2068returncode attribute to CommandError by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2072ignore_missing_imports option by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2058django.core.servers.basehttp by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2070django.template.base.Template.render() argument type by @Majsvaffla in https://github.com/typeddjango/django-stubs/pull/1160django.utils.choices by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2075django.contrib.sitemaps, django.contrib.staticfiles by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2076reportMissingTypeArgument, reportPrivateUsage) by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2077django.contrib.postgres by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2078path signature for async views by @jlost in https://github.com/typeddjango/django-stubs/pull/2085Reversible base class from QuerySet by @intgr in https://github.com/typeddjango/django-stubs/pull/2094Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.7...5.0.0
mypy 1.7: Recommended mypy version updated to 1.7.x
ManyToManyField and Model.<manytomany>.throughRelatedManager or ManyRelatedManager, update those to django-stubs-ext:
from django_stubs_ext.db.models.manager import ManyRelatedManager, RelatedManager@cached_property properties with class variables or @property properties.ManyToManyDescriptor and fixed Model.<manytomany>.through typing by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1805Self-typed custom queryset methods to be compatible with QuerySet by @moranabadie in https://github.com/typeddjango/django-stubs/pull/1852RelatedManager, ManyRelatedManager stub-only classes by @intgr in https://github.com/typeddjango/django-stubs/pull/1834TypedModelMeta ordering attribute to allow OrderBy objects by @HansAarneLiblik in https://github.com/typeddjango/django-stubs/pull/1847search_help_text= parameter to ChangeList.__init__() by @quinox in https://github.com/typeddjango/django-stubs/pull/1801migrations.RunSQL() by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1803SuccessMessageMixin.form_valid() by @SukiCZ in https://github.com/typeddjango/django-stubs/pull/1812db_comment= parameter position for django.db.models.Field.__init__() by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1815RelatedField.__init__() method and removed ForeignObject.__init__(db_constraint=) parameter in Field constructors by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1816assertNumQueries() and assertQuerySetEqual() by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1823get_deleted_objects() return from list[Model] -> list[str] by @golgor in https://github.com/typeddjango/django-stubs/pull/1825django.db.models re-exports by @intgr in https://github.com/typeddjango/django-stubs/pull/1835TemplateResponse.cookies attribute and SimpleCookie type by @apollo13 in https://github.com/typeddjango/django-stubs/pull/1702django.contrib.postgres.expressions by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1765django.contrib.gis.gdal.libgdal by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1811@deconstructible as a mixin class by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1818django.db.models.enums.* modules by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1819BaseExpression.contains_subquery() method (update to Django 4.2.7) by @intgr in https://github.com/typeddjango/django-stubs/pull/1827QuerySet by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1822Collector and NestedObjects attributes, methods by @intgr in https://github.com/typeddjango/django-stubs/pull/1826django.db.models.functions.MD5() database function by @kevinmarsh in https://github.com/typeddjango/django-stubs/pull/1830BaseModelAdmin attributes to be either list or tuple by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1832BaseModelAdmin methods to return either list or tuple by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1833capfirst() None return by @intgr in https://github.com/typeddjango/django-stubs/pull/1842django.core.management.commands modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1829Model._do_update() method signature by @pfouque in https://github.com/typeddjango/django-stubs/pull/1854functools.cached_property definition instead of defining our own by @intgr in https://github.com/typeddjango/django-stubs/pull/1771@property attributes to @cached_property part 1 by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1761@property attributes to @cached_property part 2 by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1768output_field to @cached_property or ClassVar and improves type by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1769<Model>_RelatedManager entries to allowlist by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1806RelatedManager to django.db.models.fields.related_descriptors by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1814RelatedManager, ManyRelatedManager to inherit from Manager not BaseManager by @intgr in https://github.com/typeddjango/django-stubs/pull/1843Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.6...4.2.7
mypy 1.6: Recommended mypy version updated to 1.6.x
mypy 1.6: Recommended mypy version updated to 1.6.x
Next django-stubs version (4.2.6) will remove direct mypy dependency. If you are using mypy, please add an explicit mypy dev dependency to your project, or install django-stubs with the extra django-stubs[compatible-mypy].
Mypy remains the only supported type checker. Improvements for other type checkers may be considered in the future, pull requests welcome. See #1628 for details.
Officially added Python 3.12 support
default_storage produce a Storage object by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1665SyndicationFeed methods by @WhyNotHugo in https://github.com/typeddjango/django-stubs/pull/1705Migration.operations attribute by @asottile in https://github.com/typeddjango/django-stubs/pull/1707Migration list attributes by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1710bases= parameter in CreateModel migration op to allow for mixins by @asottile in https://github.com/typeddjango/django-stubs/pull/1708_Composable protocol for compatibility with psycopg2-stubs change by @andersk in https://github.com/typeddjango/django-stubs/pull/1714django.views modules by @GabDug in https://github.com/typeddjango/django-stubs/pull/1716null and validators arguments from ManyToManyField.__init__ by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1720django.test modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1752BaseModelForm, ErrorList, ErrorDict constructor renderer= parameter by @GabDug in https://github.com/typeddjango/django-stubs/pull/1690deconstruct methods by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1695SQLCompiler methods by @ashm-tech in https://github.com/typeddjango/django-stubs/pull/1689max_length attribute to forms.FileField by @GabDug in https://github.com/typeddjango/django-stubs/pull/1715Layer.num_feat attribute (GeoDjango) by @niconoe in https://github.com/typeddjango/django-stubs/pull/1722AbstractBaseUser.REQUIRED_FIELDS as ClassVar by @WhyNotHugo in https://github.com/typeddjango/django-stubs/pull/1737fields.Field.formfield() method by @WhyNotHugo in https://github.com/typeddjango/django-stubs/pull/1739ModelStateFieldsCacheDescriptor.__get__ method by @asottile in https://github.com/typeddjango/django-stubs/pull/1743Model._meta to ClassVar[Options[Self]] by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1732django.test.signals types by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1751@cached_property decorated method by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1766psycopg2.sql.SQL in QuerySet.raw() by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1767django.middleware.csrf module by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1770django.core.cache modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1774Field.formfield(), GeometryField.formfield() methods by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1724F.resolve_expression() return type by @schinckel in https://github.com/typeddjango/django-stubs/pull/1659Manager methods through manager MRO by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1701functools.cached_property instead of Django's in mypy plugin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1721ReverseOneToOneDescriptor and start using it by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1733ManyToManyField's through model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1719settings.AUTH_USER_MODEL used as to= in relation by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1746_default_manager symbol to generated through model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1745AssertionError crashes.AssertionError crashes.ValueError crashes.django_stubs_ext by @tony in https://github.com/typeddjango/django-stubs/pull/1747 & https://github.com/typeddjango/django-stubs/pull/1748deconstruct methods. by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1693 & https://github.com/typeddjango/django-stubs/pull/1694parse_bool implementation from mypy by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1703# type: ignore comments for plugin code by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1726# type: ignore comments in stubs files by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1734Manager.from_queryset() handles invalid argument types by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1731Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.4...4.2.5
Applied Django 4.2 deprecations by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1523
mypy 1.4: Recommended mypy version updated to 1.4.x
Support for django-split-settings, django-configurations and other Django settings addons with strict_settings = false option, see README for details
We have now adopted mypy's stubtest to automatically find discrepancies between Django and django-stubs.
If you want to contribute to django-stubs but are not sure where to start, have a look at stubtest's TODO list file, which lists the many issues discovered by stubtest.
AppConfig class to match Django 4.2 by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1524ManifestStaticFilesStorage new parameters by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1528Sitemap class by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1527headers= parameter to (Async)RequestFactory and (Async)Client classes by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1529
^ and ~ operator support, JSON lookup classes, Postgres lookup classes, ModelForm changes, json_script template filter parameters by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1536db.backends DatabaseIntrospection and DatabaseOperations classes by @GabDug in https://github.com/typeddjango/django-stubs/pull/1571QuerySet._result_cache attribute and _fetch_all() method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1505ModelAdmin.search_help_text attribute by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1546EmailBackend.write_message() method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1547ModelAdmin.get_formset_kwargs() method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1545Signal._live_receivers() method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1551SQLCompiler._order_by_pairs() method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1586memcache_key_warnings() function by @rvanlaar in https://github.com/typeddjango/django-stubs/pull/1562create_model_instance incorrect data argument type by @namper in https://github.com/typeddjango/django-stubs/pull/1521RequestSite.{save,delete} methods as NoReturn since they always raise by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1530SafeExceptionReporterFilter attributes and removed obsolete CLEANSED_SUBSTITUTE by @mthuurne in https://github.com/typeddjango/django-stubs/pull/1540AppConfig.default_auto_field to attribute instead of method by @mthuurne in https://github.com/typeddjango/django-stubs/pull/1541default_error_messages attribute type of base Field and GenericIPAddressField classes by @asottile in https://github.com/typeddjango/django-stubs/pull/1538DatabaseWrapper attributes by @filbasi in https://github.com/typeddjango/django-stubs/pull/1544dispatch.dispatcher by @GabDug in https://github.com/typeddjango/django-stubs/pull/1567str field names for Window.order_by(), allow None for asc/desc arguments by @GabDug in https://github.com/typeddjango/django-stubs/pull/1574django.utils.* types from stubtest by @GabDug in https://github.com/typeddjango/django-stubs/pull/1575db.migrations.operations types from stubtest by @GabDug in https://github.com/typeddjango/django-stubs/pull/1583StepValueValidator, fixed argument for SRIDCacheEntry/EmailValidator, improved urls.resolvers types by @GabDug in https://github.com/typeddjango/django-stubs/pull/1589ForeignKey queryset filters on un-swapped models by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1495strict_settings option, allow runtime fallbacks for custom settings by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1557
KeyError: 'model_bases' and related errors by @intgr in https://github.com/typeddjango/django-stubs/pull/1563TypedDatabaseRouter as database router base class by @intgr in https://github.com/typeddjango/django-stubs/pull/1522--generate-allowlist by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1576ArrayField by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1558
mypy_extensions by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1566flake8 plugins by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1579Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.1...4.2.2
mypy 1.3.0: Recommended mypy version updated to 1.3.0
db_comment= argument on Model fields by @andrlik in https://github.com/typeddjango/django-stubs/pull/1492core.files.storages types for Django 4.2 by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1488StreamingHttpResponse by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1484robust parameter to transaction.on_commit() by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1469django.conf constants Literals by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1470TypedModelMeta for typing Model inner Meta class. This feature was deferred from the previous version due to a bug. by @intgr in https://github.com/typeddjango/django-stubs/pull/1375, https://github.com/typeddjango/django-stubs/pull/1456
__init__.py in django_stubs_ext.db by @monosans in https://github.com/typeddjango/django-stubs/pull/1460cache_page, cache_control, sensitive_variables, sensitive_post_parameters, condition, etag, last_modified) by @Kostia-K in https://github.com/typeddjango/django-stubs/pull/1465ManyToManyRawIdWidget to accept ManyToManyRel argument by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1447classonlymethod decorator declaration by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1494admin.sites.get_app_list() by @AkaZecik in https://github.com/typeddjango/django-stubs/pull/1497lookup_needs_distinct() function by @AkaZecik in https://github.com/typeddjango/django-stubs/pull/1498_make_token_with_timestamp() argument secret type by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1462send_mass_email() argument type to allow None by @dlesbre in https://github.com/typeddjango/django-stubs/pull/1516UserCreationForm generic by @monosans in https://github.com/typeddjango/django-stubs/pull/1518SessionBase methods, improved SessionStore.get_model_class() return type by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1517__init__.py with flake8-no-pep420 by @intgr in https://github.com/typeddjango/django-stubs/pull/1461Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.0...4.2.1
New version scheme: django-stubs will now use the same major.minor version number as Django. Our Django support policy remains the same: Older version
django.utils.http.content_disposition_header() function by @alexmv in https://github.com/typeddjango/django-stubs/pull/1448Model methods by @bigfootjon in https://github.com/typeddjango/django-stubs/pull/1443Query.join() method by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1404Query.where attribute by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1407Model methods date_error_message(), get_constraints(), serializable_value(), prepare_database_save()
Added app_label= argument to AdminSite.get_app_list() by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1413BaseConstraint.default_violation_error_message attribute by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1419BaseUserCreationForm class by @monosans in https://github.com/typeddjango/django-stubs/pull/1424Form, FormSet, BoundField, ErrorDict and ErrorList rendering types.
Added IntegerField.step_size attribute and argument by @monosans in https://github.com/typeddjango/django-stubs/pull/1427JSONObject.__init__() constructor by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1430RenameIndex migration from Django 4.1 by @karamanolev in https://github.com/typeddjango/django-stubs/pull/1438STORAGES setting by @federicobond in https://github.com/typeddjango/django-stubs/pull/1439violation_error_message arguments, attributes by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1418SECRET_KEY to be str or bytes, add SECRET_KEY_FALLBACKS, update PasswordResetTokenGenerator by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1411BaseExpression to UniqueConstraint.expressions by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1420StreamingReponse by @rik in https://github.com/typeddjango/django-stubs/pull/1421Manager.delete() method which is not accessible on Manager by @mschoettle in https://github.com/typeddjango/django-stubs/pull/1431aiterator() method of QuerySet and BaseManager by @kjagiello in https://github.com/typeddjango/django-stubs/pull/1449Feed items do not need to be Model instances by @bigfootjon in https://github.com/typeddjango/django-stubs/pull/1444Manager and QuerySet classes to be inner class of Model by @federicobond in https://github.com/typeddjango/django-stubs/pull/1392ForeignKey in abstract models when using to= with a string reference by @Kircheneer in https://github.com/typeddjango/django-stubs/pull/1436QuerySet.values_list() by @leamingrad in https://github.com/typeddjango/django-stubs/pull/1441Model relations created with ForeignObject/ForeignObjectRel by @Photonios in https://github.com/typeddjango/django-stubs/pull/1451tomli dependency on Python>=3.11 by @monosans in https://github.com/typeddjango/django-stubs/pull/1423QuerySet.select_related returning queryset type by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1400decorators.AsyncGetResponseCallable Protocol, but is not yet used anywhere by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1425BaseModelMeta for typing Model inner Meta class by @intgr in https://github.com/typeddjango/django-stubs/pull/1375BaseModelMeta to TypedModelMeta and document it by @intgr in https://github.com/typeddjango/django-stubs/pull/1456Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.16.0...4.2.0
Make BaseConnectionHandler generic in monkeypatching by @adambirds in https://github.com/typeddjango/django-stubs/pull/1349
BaseConnectionHandler generic in monkeypatching by @adambirds in https://github.com/typeddjango/django-stubs/pull/1349QuerySetAny type for QuerySet isinstance checks by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1199FormMixin's get_form() and get_form_class()QuerySet.in_bulk(), thanks to @syastrovtransaction.atomic reworked, thanks to @syastrov
transaction.atomic reworked, thanks to @syastrovUpgrade mypy support to 0.960 by @DamianZaremba in https://github.com/typeddjango/django-stubs/pull/973
self by @blueyed in https://github.com/typeddjango/django-stubs/pull/970django.core.cache.cache to BaseCache by @flaeppe in https://github.com/typeddjango/django-stubs/pull/998Full Changelog: https://github.com/typeddjango/django-stubs/compare/v1.11.0...django-stubs-ext@0.5.0
django.shortcuts.get_object_or_404 and django.shortcuts.get_list_or_404. https://github.com/mkurnikov/django-stubs/issues/22django.contrib.auth.get_user_model() https://github.com/mkurnikov/django-stubs/issues/16Any.Support for typechecking of Model.__init__() and BaseManager.create() arguments
Model.__init__() and BaseManager.create() argumentsobjects and _default_manager managersNothing published for this version
Bunch of fixes / missing reimports.
Add objects attribute to models.Model, so now TypeVars with bound=models.Model work correctly.
django.utils.dates.objects attribute to models.Model, so now TypeVars with bound=models.Model work correctly.Nothing published for this version
Your coding agent can read these notes before it upgrades. Set up the MCP server →