Update dependency django-stubs to v5
This MR contains the following updates:
Package | Type | Update | Change |
---|---|---|---|
django-stubs (changelog) | dev-dependencies | major |
^1.1 -> ^5.1
|
Release Notes
typeddjango/django-stubs
v5.1.1
What's Changed
- Add django 5.1 to the test matrix and add its classifier by @foarsitter in https://github.com/typeddjango/django-stubs/pull/2380
- fix function overload of Library.simple_tag by @asottile in https://github.com/typeddjango/django-stubs/pull/2390
- Fix resolve_error_handler return type by @ljodal in https://github.com/typeddjango/django-stubs/pull/2392
- Make
BaseEngine.app_dirname
non-optional by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2394 - [5.1] Add from_queryset param to
(a)refresh_from_db()
by @jacobtylerwalls in https://github.com/typeddjango/django-stubs/pull/2402 - Make
from_string()
andget_template()
return backend-specific template by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2400 - Update type of the
get_session_auth_fallback_hash
method to the correct type by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2407 - Fix TypedDictType crash with mypy 1.12.x by @federicobond in https://github.com/typeddjango/django-stubs/pull/2408
- Remove EOL Python 3.8 and add 3.13 to CI by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2397
- Treat
QuerySet.alias
likeQuerySet.annotate
by @andersk in https://github.com/typeddjango/django-stubs/pull/2411 - Fixes #2413 -- update ModelAdmin.log_FOO method signatures by @sergei-maertens in https://github.com/typeddjango/django-stubs/pull/2414
- Update
db.migrations.serializer
by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2421 - Update
django.conf.global_settings
by @JaeHyuckSa in https://github.com/typeddjango/django-stubs/pull/2420 - Allow
None
onview_on_site
by @nijel in https://github.com/typeddjango/django-stubs/pull/2419 - Version 5.1.1 release by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2424
New Contributors
- @foarsitter made their first contribution in https://github.com/typeddjango/django-stubs/pull/2380
- @sergei-maertens made their first contribution in https://github.com/typeddjango/django-stubs/pull/2414
- @nijel made their first contribution in https://github.com/typeddjango/django-stubs/pull/2419
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.1.0...5.1.1
v5.1.0
Headline changes
- Refactor support for
annotate
to utilisemypy.types.Instance.extra_attrs
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2319 - Resolve configured
AUTH_USER_MODEL
with aget_type_analyze_hook
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2335
What's Changed
- Fix type hints for
SimpleTestCase
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2289 - Check correct model on m2m reverse values/values_list by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2288
- match Field TypeVar variance in models.fields.related by @asottile in https://github.com/typeddjango/django-stubs/pull/2292
- try and use named arguments from caller for matching name by @asottile in https://github.com/typeddjango/django-stubs/pull/2294
- Allow
fields
being anIterable
inbulk_update
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2296 - Test usage of
from_queryset
manager as reverse manager by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2295 - A workaround for #2299 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2300
- Run mypy with
--strict
onassert_type
tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2301 - Improve
get_context_object_name
onSingleObjectMixin
andMultipleObjectMixin
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2298 - Update pyright to 1.1.374 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2305
- Remove
BaseManager.cache
attribute by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2309 - Loosen bound on
CurrentSiteManager
manager type var by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2308 - Update build status link for
django-stubs-ext
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2310 - Use
Any
forConnectionProxy
attributes by @RealOrangeOne in https://github.com/typeddjango/django-stubs/pull/2311 - Remove
FieldDoesNotExist
from where it's not present at runtime by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2313 - Declare
ManyToManyField.description
a_StrOrPromise
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2312 - Don't populate a type arg for non generic managers by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2314
- Fixed bugs with RawQuerySet by @ashm-dev in https://github.com/typeddjango/django-stubs/pull/2316
- Add Typing for EmailField with Support for String Set and Get Types by @ashm-dev in https://github.com/typeddjango/django-stubs/pull/2317
- Do
models.Model
adjustments fromget_metaclass_hook
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2322 - Bump django from 5.0.7 to 5.0.8 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2325
- This MR adds some defaults to stubs with
stubdefaulter
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2326 - Add a lot of runtime defaults to stubs with
stubdefaulter
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2327 - Fix
tuple[A]
types to betuple[A, ...]
types by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2328 - Check annotated fields in
<QuerySet>.filter
call by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2332 - Refactor: Unify plugin check for model type info by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2286
- Enable
mypy.plugins.proper_plugin
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2333 - Use mypy's
make_optional_type
instead of shipping our own by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2334 - Add arbitrary named arguments to @receiver decorator by @craigds in https://github.com/typeddjango/django-stubs/pull/2342
- Bump django from 5.0.8 to 5.1 by @Viicos in https://github.com/typeddjango/django-stubs/pull/2347
- Don't modify return values of manager methods in place, modify a copy instead by @jkaikkosplk in https://github.com/typeddjango/django-stubs/pull/2345
- [5.1] Add slicing notation to F expressions by @Viicos in https://github.com/typeddjango/django-stubs/pull/1897
- 5.1: Deprecate CheckConstraint.check by @q0w in https://github.com/typeddjango/django-stubs/pull/2331
- feat: Add missing stubs by @BradleyKirton in https://github.com/typeddjango/django-stubs/pull/2348
- Update
utils
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2352 - Update
contrib.sessions.backends
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2351 - Update django to 5.1.1 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2360
- Allow None return form model Field.formfield() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/2363
- add cache_name for django 5.1 by @asottile in https://github.com/typeddjango/django-stubs/pull/2365
- Update Django 4.2 LTS version to 4.2.16 by @intgr in https://github.com/typeddjango/django-stubs/pull/2369
- Document the release process by @intgr in https://github.com/typeddjango/django-stubs/pull/2371
- Allow lookups on
.annotate
fields by @sterliakov in https://github.com/typeddjango/django-stubs/pull/2376 - Break what apparently is a cycle involving custom User model and
QuerySet.as_manager()
by @sterliakov in https://github.com/typeddjango/django-stubs/pull/2377 - Version 5.1.0 release by @richardebeling in https://github.com/typeddjango/django-stubs/pull/2374
New Contributors
- @RealOrangeOne made their first contribution in https://github.com/typeddjango/django-stubs/pull/2311
- @ashm-dev made their first contribution in https://github.com/typeddjango/django-stubs/pull/2316
- @craigds made their first contribution in https://github.com/typeddjango/django-stubs/pull/2342
- @jkaikkosplk made their first contribution in https://github.com/typeddjango/django-stubs/pull/2345
- @BradleyKirton made their first contribution in https://github.com/typeddjango/django-stubs/pull/2348
- @richardebeling made their first contribution in https://github.com/typeddjango/django-stubs/pull/2374
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.4...5.1.0
v5.0.4
What's Changed
This is a re-release of django-stubs 5.0.3
with a minor fix:
- Check correct model on other side of many to many reverse filtering by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2283
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.3...5.0.4
Release notes for version 5.0.3
What's Changed
- Release workflow: publish
django-stubs-ext
beforedjango-stubs
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2188 - Migrate
apps/test_config.yml
'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2190 - Add
ManyToManyField.m2m_field_name
andModel._get_pk_val
methods by @YPCrumble in https://github.com/typeddjango/django-stubs/pull/2177 -
Lookup
should be a subtype ofExpression
by @mkurnikov in https://github.com/typeddjango/django-stubs/pull/2199 - Update
django.db.models.functions
: allowCombinable
as parameter, addRound
function by @noamkush in https://github.com/typeddjango/django-stubs/pull/2195 - Add missing
django.core.management.utils
functions by @Viicos in https://github.com/typeddjango/django-stubs/pull/2200 - Improve
django.middleware
stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2202 - Improve
django.http
stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2201 - Tests: Migrate
db/models/test_constraints.yml
to 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2204 - Allow any function for admin's
display
andaction
decorators by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2210 - Remove invalid re-export
django.forms.ChoiceWidget
by @asottile in https://github.com/typeddjango/django-stubs/pull/2207 - Model._meta.pk is non-None by @asottile in https://github.com/typeddjango/django-stubs/pull/2218
- update / create defaults are read-only Mapping by @asottile in https://github.com/typeddjango/django-stubs/pull/2216
- Add missing math.Random database function by @noamkush in https://github.com/typeddjango/django-stubs/pull/2222
- Make
ReverseManyToOneDescriptor
generic over a model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2227 - Extract through table creation to separate method by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2229
- Do many related manager creation during semantic analysis by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2231
- Expand CheckRegistry.register as function (#2232) by @jwhitlock in https://github.com/typeddjango/django-stubs/pull/2233
- don't copy magic or private methods in from_queryset managers by @asottile in https://github.com/typeddjango/django-stubs/pull/2240
- Make plugin handle explicitly declared reverse descriptors for FKs by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2230
- Expect a
QuerySet
for multiple defaults inMultipleObjectMixin
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2191 - fix handling of explicit
objects
annotation by @asottile in https://github.com/typeddjango/django-stubs/pull/2241 - Add atomic_blocks to base DB wrapper by @palfrey in https://github.com/typeddjango/django-stubs/pull/2242
- walk mro for Field set type annotations by @asottile in https://github.com/typeddjango/django-stubs/pull/2244
- Add
serialized_aliases
parameter tosetup_databases
function indjango.test.utils
by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2247 - use field annotations for values_list types by @asottile in https://github.com/typeddjango/django-stubs/pull/2248
- Improve types of
ConnectionProxy
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2246 - Add
get_template_tag_modules
function signature todjango.template.backends.django
by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2250 - add PlaceholderNode when deferring manager class hook by @asottile in https://github.com/typeddjango/django-stubs/pull/2228
- Update function signatures for
django.db.models.sql.Query
class by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2253 - Update
admin.sites._ViewType
bound to allowStreamingHttpResponse
by @savanto in https://github.com/typeddjango/django-stubs/pull/2256 - Add
Options._get_fields
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2254 - Support inheriting ManyToManyField from an abstract model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2260
- Allow single generic param for Field in ForeignKey by @rafonseca in https://github.com/typeddjango/django-stubs/pull/2261
- Refactor: Unify plugin check for model type info by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2263
- add
Path
type argument to tuple returned byget_app_template_dirs
by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2266 - add missing type argument to
Paginator
by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2271 - Update mypy to 1.11.0 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2269
- Check calls to filtering manager methods involving
ManyToManyField
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2275 - Prepare for a release
5.0.3
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2274 - lookup manager type via mro by @asottile in https://github.com/typeddjango/django-stubs/pull/2276
- Check model fields on filtering methods of queryset types by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2277
- fill QuerySet generics using the manager's model type by @asottile in https://github.com/typeddjango/django-stubs/pull/2281
- convert as_manager hooks to base class hook by @asottile in https://github.com/typeddjango/django-stubs/pull/2282
New Contributors
- @YPCrumble made their first contribution in https://github.com/typeddjango/django-stubs/pull/2177
- @jwhitlock made their first contribution in https://github.com/typeddjango/django-stubs/pull/2233
- @DongwookKim0823 made their first contribution in https://github.com/typeddjango/django-stubs/pull/2247
- @savanto made their first contribution in https://github.com/typeddjango/django-stubs/pull/2256
- @rafonseca made their first contribution in https://github.com/typeddjango/django-stubs/pull/2261
- @joshuadavidthomas made their first contribution in https://github.com/typeddjango/django-stubs/pull/2266
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.2...5.0.3
v5.0.3
What's Changed
- Release workflow: publish
django-stubs-ext
beforedjango-stubs
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2188 - Migrate
apps/test_config.yml
'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2190 - Add
ManyToManyField.m2m_field_name
andModel._get_pk_val
methods by @YPCrumble in https://github.com/typeddjango/django-stubs/pull/2177 -
Lookup
should be a subtype ofExpression
by @mkurnikov in https://github.com/typeddjango/django-stubs/pull/2199 - Update
django.db.models.functions
: allowCombinable
as parameter, addRound
function by @noamkush in https://github.com/typeddjango/django-stubs/pull/2195 - Add missing
django.core.management.utils
functions by @Viicos in https://github.com/typeddjango/django-stubs/pull/2200 - Improve
django.middleware
stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2202 - Improve
django.http
stubs by @Viicos in https://github.com/typeddjango/django-stubs/pull/2201 - Tests: Migrate
db/models/test_constraints.yml
to 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2204 - Allow any function for admin's
display
andaction
decorators by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2210 - Remove invalid re-export
django.forms.ChoiceWidget
by @asottile in https://github.com/typeddjango/django-stubs/pull/2207 - Model._meta.pk is non-None by @asottile in https://github.com/typeddjango/django-stubs/pull/2218
- update / create defaults are read-only Mapping by @asottile in https://github.com/typeddjango/django-stubs/pull/2216
- Add missing math.Random database function by @noamkush in https://github.com/typeddjango/django-stubs/pull/2222
- Make
ReverseManyToOneDescriptor
generic over a model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2227 - Extract through table creation to separate method by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2229
- Do many related manager creation during semantic analysis by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2231
- Expand CheckRegistry.register as function (#2232) by @jwhitlock in https://github.com/typeddjango/django-stubs/pull/2233
- don't copy magic or private methods in from_queryset managers by @asottile in https://github.com/typeddjango/django-stubs/pull/2240
- Make plugin handle explicitly declared reverse descriptors for FKs by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2230
- Expect a
QuerySet
for multiple defaults inMultipleObjectMixin
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2191 - fix handling of explicit
objects
annotation by @asottile in https://github.com/typeddjango/django-stubs/pull/2241 - Add atomic_blocks to base DB wrapper by @palfrey in https://github.com/typeddjango/django-stubs/pull/2242
- walk mro for Field set type annotations by @asottile in https://github.com/typeddjango/django-stubs/pull/2244
- Add
serialized_aliases
parameter tosetup_databases
function indjango.test.utils
by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2247 - use field annotations for values_list types by @asottile in https://github.com/typeddjango/django-stubs/pull/2248
- Improve types of
ConnectionProxy
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2246 - Add
get_template_tag_modules
function signature todjango.template.backends.django
by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2250 - add PlaceholderNode when deferring manager class hook by @asottile in https://github.com/typeddjango/django-stubs/pull/2228
- Update function signatures for
django.db.models.sql.Query
class by @DongwookKim0823 in https://github.com/typeddjango/django-stubs/pull/2253 - Update
admin.sites._ViewType
bound to allowStreamingHttpResponse
by @savanto in https://github.com/typeddjango/django-stubs/pull/2256 - Add
Options._get_fields
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2254 - Support inheriting ManyToManyField from an abstract model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2260
- Allow single generic param for Field in ForeignKey by @rafonseca in https://github.com/typeddjango/django-stubs/pull/2261
- Refactor: Unify plugin check for model type info by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2263
- add
Path
type argument to tuple returned byget_app_template_dirs
by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2266 - add missing type argument to
Paginator
by @joshuadavidthomas in https://github.com/typeddjango/django-stubs/pull/2271 - Update mypy to 1.11.0 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2269
- Check calls to filtering manager methods involving
ManyToManyField
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2275 - Prepare for a release
5.0.3
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2274 - lookup manager type via mro by @asottile in https://github.com/typeddjango/django-stubs/pull/2276
- Check model fields on filtering methods of queryset types by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2277
- fill QuerySet generics using the manager's model type by @asottile in https://github.com/typeddjango/django-stubs/pull/2281
- convert as_manager hooks to base class hook by @asottile in https://github.com/typeddjango/django-stubs/pull/2282
New Contributors
- @YPCrumble made their first contribution in https://github.com/typeddjango/django-stubs/pull/2177
- @jwhitlock made their first contribution in https://github.com/typeddjango/django-stubs/pull/2233
- @DongwookKim0823 made their first contribution in https://github.com/typeddjango/django-stubs/pull/2247
- @savanto made their first contribution in https://github.com/typeddjango/django-stubs/pull/2256
- @rafonseca made their first contribution in https://github.com/typeddjango/django-stubs/pull/2261
- @joshuadavidthomas made their first contribution in https://github.com/typeddjango/django-stubs/pull/2266
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.2...5.0.3
v5.0.2
What's Changed
This is a re-release of django-stubs 5.0.1
with a minor fix:
- Set lower bound of
django-stubs-ext
dependency to5.0.2
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2186
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.1...5.0.2
Release notes for version 5.0.1
Headline changes
-
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
andValuesQuerySet
can now be replaced with simpleQuerySet
by @intgr in https://github.com/typeddjango/django-stubs/pull/2104
What's Changed
- 5.0: Update
django.contrib.admin.views
anddjango.forms.forms.Form
metaclass by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2079 - Fix IndexError for custom queryset managers by @meshy in https://github.com/typeddjango/django-stubs/pull/1913
- 5.0: Update
django.db.models.lookups
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2103 - 5.0: Update
django.db.backends.utils
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2102 - 5.0: Update
django.forms.field.Field
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2107 - 5.0: Update
django.contrib.messages.storage.cookie
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2106 - Tests: Add test case for settings import cycle by @intgr in https://github.com/typeddjango/django-stubs/pull/2098
- 5.0: Update
django.db.models.expressions
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2110 - 5.0: Update
django.contrib.auth.backends
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2111 - 5.0: Update
django.contrib.auth.base_user
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2113 - 5.0: Update
django.db.migrations.serializer
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2109 - 5.0: Update
django.db.backends.base.features.BaseDatabaseFeature
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2099 - 5.0: Update
django.db.backends.base.operations.BaseDatabaseOperations
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2100 - Fix annotation for
request.auser
by @bshelkhonov in https://github.com/typeddjango/django-stubs/pull/2108 - 5.0: Update
django.contrib.gis.admin.widgets
anddjango.contrib.gis.admin.options
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2116 - 5.0: Update
django.forms.boundfield
anddjango.forms.utils
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2118 - Prepare django-stubs-ext for QuerySet typevar refactor by @intgr in https://github.com/typeddjango/django-stubs/pull/2117
-
BaseBackend.get_user
: Relaxuser_id
param type by @tony in https://github.com/typeddjango/django-stubs/pull/2121 - 5.0: Update
django.forms.renderers
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2119 - 5.0: Update
django.forms.forms
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2122 - 5.0: Update
django.contrib.gis.db.backends.sqatialite.schema
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2123 - Improve types in DB backend
schema
modules by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2124 - 5.0: Update
django.contrib.messages.test
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2126 - [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/2129
- More pre-commit checks by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2132
- Bump django from 5.0.5 to 5.0.6 by @dependabot in https://github.com/typeddjango/django-stubs/pull/2135
- 5.0: Update
django.contrib.contenttypes.prefetch
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2115 - 5.0: Update
django.contrib.admin.widgets
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2105 - 5.0: Update
django.contrib.contenttypes.fields.GenericForeignKey
methods by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2137 - Relax typing of
backend
indjango.contrib.auth
(ModelBackend
->BaseBackend
) by @tony in https://github.com/typeddjango/django-stubs/pull/2141 - fix: UserAdmin accepts AbstractUser by @vadimshvetsov in https://github.com/typeddjango/django-stubs/pull/2139
- 4.2.8: Update
Query.resolve_lookup_value()
parameters by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2136 - Increase priority of mypy internal Django settings import by @intgr in https://github.com/typeddjango/django-stubs/pull/2127
- Fix 'Import cycle from Django settings module' errors function context by @intgr in https://github.com/typeddjango/django-stubs/pull/2142
- Adjust priority of Django settings import again by @intgr in https://github.com/typeddjango/django-stubs/pull/2143
- 5.0: Update
django.forms.models
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2146 - Add typing of
django.db.migrations.autodetector
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2149 - 5.0: Update
django.db.models.enums
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2148 - 5.0: Update
django.forms.widgets
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2147 - Add GitHub actions release workflow for
django-stubs-ext
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2150 - 5.0: Update
django.db.models.field.related
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2151 - Bump pre-commit from 3.7.0 to 3.7.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/2155
- Fix
TextChoices.__new__()
parameter type by @mvaled in https://github.com/typeddjango/django-stubs/pull/2156 - Ensure ManyToManyField related managers supports renamed imports by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2153
- 5.0: Update
django.contrib.gis.db.backends.postgis.operations
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2138 - 5.0: Update
django.db.models.fields.reverse_related
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2158 - 5.0: Update
django.db.models.field
: addgenerated
attribute to model fields by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2152 - 5.0: Update
django.db.models.sql.datastructures
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2159 - 5.0: Update
django.db.models.query
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2160 - [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/2161
- 5.0: Update
django.db.models.sql.compiler
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2166 - 5.0: Update
django.db.models.functions.datetime
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2167 - 5.0: Update
django.forms.formsets
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2145 - 5.0: Update
django.db.models.query_utils
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2165 - Bump pytest from 8.2.0 to 8.2.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/2169
- 5.0: Update
django.db.models.functions.datetime.Now
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2173 - 5.0: Update
django.db.models.sql.query.Query
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2172 - 5.0: Update
django.db.models.field.related_descriptors
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2157 - 5.0: Update django.db.models.constraints.UniqueConstraint by @steve148 in https://github.com/typeddjango/django-stubs/pull/2175
- 5.0: Update
django.db.models.expressions
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2176 - Add
BaseConstraint.get_violation_error_message()
by @q0w in https://github.com/typeddjango/django-stubs/pull/2178 - Fix signature of Choices member creation, add
assert_type
test cases, runpyright
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2162 -
AbstractBaseSession
: Use model fields for subclassed cases by @tony in https://github.com/typeddjango/django-stubs/pull/2180 - Migrate 'test_conf.yml' to 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2182
- Don't crash when inspecting classes loaded from cache by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2185
- Formset get_queryset() returns QuerySet by @MrkGrgsn in https://github.com/typeddjango/django-stubs/pull/2174
- Prepare for a release
5.0.1
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2183
New Contributors
- @meshy made their first contribution in https://github.com/typeddjango/django-stubs/pull/1913
- @bshelkhonov made their first contribution in https://github.com/typeddjango/django-stubs/pull/2108
- @vadimshvetsov made their first contribution in https://github.com/typeddjango/django-stubs/pull/2139
- @mvaled made their first contribution in https://github.com/typeddjango/django-stubs/pull/2156
- @steve148 made their first contribution in https://github.com/typeddjango/django-stubs/pull/2175
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.0...5.0.1
v5.0.1
Headline changes
-
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
andValuesQuerySet
can now be replaced with simpleQuerySet
by @intgr in https://github.com/typeddjango/django-stubs/pull/2104
What's Changed
- 5.0: Update
django.contrib.admin.views
anddjango.forms.forms.Form
metaclass by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2079 - Fix IndexError for custom queryset managers by @meshy in https://github.com/typeddjango/django-stubs/pull/1913
- 5.0: Update
django.db.models.lookups
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2103 - 5.0: Update
django.db.backends.utils
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2102 - 5.0: Update
django.forms.field.Field
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2107 - 5.0: Update
django.contrib.messages.storage.cookie
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2106 - Tests: Add test case for settings import cycle by @intgr in https://github.com/typeddjango/django-stubs/pull/2098
- 5.0: Update
django.db.models.expressions
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2110 - 5.0: Update
django.contrib.auth.backends
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2111 - 5.0: Update
django.contrib.auth.base_user
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2113 - 5.0: Update
django.db.migrations.serializer
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2109 - 5.0: Update
django.db.backends.base.features.BaseDatabaseFeature
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2099 - 5.0: Update
django.db.backends.base.operations.BaseDatabaseOperations
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2100 - Fix annotation for
request.auser
by @bshelkhonov in https://github.com/typeddjango/django-stubs/pull/2108 - 5.0: Update
django.contrib.gis.admin.widgets
anddjango.contrib.gis.admin.options
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2116 - 5.0: Update
django.forms.boundfield
anddjango.forms.utils
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2118 - Prepare django-stubs-ext for QuerySet typevar refactor by @intgr in https://github.com/typeddjango/django-stubs/pull/2117
-
BaseBackend.get_user
: Relaxuser_id
param type by @tony in https://github.com/typeddjango/django-stubs/pull/2121 - 5.0: Update
django.forms.renderers
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2119 - 5.0: Update
django.forms.forms
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2122 - 5.0: Update
django.contrib.gis.db.backends.sqatialite.schema
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2123 - Improve types in DB backend
schema
modules by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2124 - 5.0: Update
django.contrib.messages.test
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2126 - [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/2129
- More pre-commit checks by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2132
- Bump django from 5.0.5 to 5.0.6 by @dependabot in https://github.com/typeddjango/django-stubs/pull/2135
- 5.0: Update
django.contrib.contenttypes.prefetch
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2115 - 5.0: Update
django.contrib.admin.widgets
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2105 - 5.0: Update
django.contrib.contenttypes.fields.GenericForeignKey
methods by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2137 - Relax typing of
backend
indjango.contrib.auth
(ModelBackend
->BaseBackend
) by @tony in https://github.com/typeddjango/django-stubs/pull/2141 - fix: UserAdmin accepts AbstractUser by @vadimshvetsov in https://github.com/typeddjango/django-stubs/pull/2139
- 4.2.8: Update
Query.resolve_lookup_value()
parameters by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2136 - Increase priority of mypy internal Django settings import by @intgr in https://github.com/typeddjango/django-stubs/pull/2127
- Fix 'Import cycle from Django settings module' errors function context by @intgr in https://github.com/typeddjango/django-stubs/pull/2142
- Adjust priority of Django settings import again by @intgr in https://github.com/typeddjango/django-stubs/pull/2143
- 5.0: Update
django.forms.models
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2146 - Add typing of
django.db.migrations.autodetector
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2149 - 5.0: Update
django.db.models.enums
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2148 - 5.0: Update
django.forms.widgets
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2147 - Add GitHub actions release workflow for
django-stubs-ext
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2150 - 5.0: Update
django.db.models.field.related
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2151 - Bump pre-commit from 3.7.0 to 3.7.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/2155
- Fix
TextChoices.__new__()
parameter type by @mvaled in https://github.com/typeddjango/django-stubs/pull/2156 - Ensure ManyToManyField related managers supports renamed imports by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2153
- 5.0: Update
django.contrib.gis.db.backends.postgis.operations
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2138 - 5.0: Update
django.db.models.fields.reverse_related
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2158 - 5.0: Update
django.db.models.field
: addgenerated
attribute to model fields by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2152 - 5.0: Update
django.db.models.sql.datastructures
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2159 - 5.0: Update
django.db.models.query
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2160 - [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/2161
- 5.0: Update
django.db.models.sql.compiler
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2166 - 5.0: Update
django.db.models.functions.datetime
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2167 - 5.0: Update
django.forms.formsets
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2145 - 5.0: Update
django.db.models.query_utils
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2165 - Bump pytest from 8.2.0 to 8.2.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/2169
- 5.0: Update
django.db.models.functions.datetime.Now
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2173 - 5.0: Update
django.db.models.sql.query.Query
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2172 - 5.0: Update
django.db.models.field.related_descriptors
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2157 - 5.0: Update django.db.models.constraints.UniqueConstraint by @steve148 in https://github.com/typeddjango/django-stubs/pull/2175
- 5.0: Update
django.db.models.expressions
by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2176 - Add
BaseConstraint.get_violation_error_message()
by @q0w in https://github.com/typeddjango/django-stubs/pull/2178 - Fix signature of Choices member creation, add
assert_type
test cases, runpyright
by @Viicos in https://github.com/typeddjango/django-stubs/pull/2162 -
AbstractBaseSession
: Use model fields for subclassed cases by @tony in https://github.com/typeddjango/django-stubs/pull/2180 - Migrate 'test_conf.yml' to 'assert_type' tests by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2182
- Don't crash when inspecting classes loaded from cache by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2185
- Formset get_queryset() returns QuerySet by @MrkGrgsn in https://github.com/typeddjango/django-stubs/pull/2174
- Prepare for a release
5.0.1
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2183
New Contributors
- @meshy made their first contribution in https://github.com/typeddjango/django-stubs/pull/1913
- @bshelkhonov made their first contribution in https://github.com/typeddjango/django-stubs/pull/2108
- @vadimshvetsov made their first contribution in https://github.com/typeddjango/django-stubs/pull/2139
- @mvaled made their first contribution in https://github.com/typeddjango/django-stubs/pull/2156
- @steve148 made their first contribution in https://github.com/typeddjango/django-stubs/pull/2175
Full Changelog: https://github.com/typeddjango/django-stubs/compare/5.0.0...5.0.1
v5.0.0
Announcements
-
QuerySet
class no longer derives fromCollection
. If you run into errors likeincompatible type "_QuerySet[User, User]"; expected "Collection[User]"
, please read this announcement.
Headline changes
- Remove incorrect
Collection
base class and__contains__
method fromQuerySet
by @fidoriel in https://github.com/typeddjango/django-stubs/pull/1925 - Pyright joins the workflow in an advisory capacity by @jorenham in https://github.com/typeddjango/django-stubs/pull/2019
- feat: Allow setting django_settings_module from env by @armanckeser in https://github.com/typeddjango/django-stubs/pull/2021
- Add
ManyRelatedManager.through
attribute and generic type parameter by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2026
What's Changed
- Make
StrPromise
not inherit fromSequence[str]
by @intgr in https://github.com/typeddjango/django-stubs/pull/1841 - Update and prepare for Django 5.0 by @intgr in https://github.com/typeddjango/django-stubs/pull/1859
- Ensure mypy plugin processes inherited many to many fields by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1864
- Include ModelBase subclasses in plugin base class hook condition by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1863
- [5.0] Added many new a-prefixed asynchronous methods by @bigfootjon in https://github.com/typeddjango/django-stubs/pull/1741
- Remove section regarding custom queryset methods from README by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1865
- Fix type of
AppConfig.models_module
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1866 - Allow
None
in settingsMIGRATION_MODULES
dict values by @asottile in https://github.com/typeddjango/django-stubs/pull/1871 - Add type hints for
JSONField.from_db_value
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1879 - Fix/pyright unknown by @dephiros in https://github.com/typeddjango/django-stubs/pull/1873
- Fix type hints of
converters
inurls.resolvers
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1892 - Update mypy to 1.8.0 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1885
- Add
@type_check_only
to all Protocols and known stubs-only classes by @intgr in https://github.com/typeddjango/django-stubs/pull/1894 - Fix types for UniqueConstraint instantiation by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1880
- Add
ModuleType
as a possible type toURLResolver.urlconf_name
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1891 - Fix type hint of
URLPattern.default_args
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1895 - Update ruff and silence
PYI046
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1907 - Use PEP 570 syntax by @Viicos in https://github.com/typeddjango/django-stubs/pull/1908
- Fix readme settings example by @Viicos in https://github.com/typeddjango/django-stubs/pull/1910
- Fix type hint of
EmailBackend.ssl_keyfile
andEmailBackend.ssl_certfile
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1911 - Add type of
django.VERSION
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1916 - Added
CommandParser
tocommands.__init__
by @jamesbraza in https://github.com/typeddjango/django-stubs/pull/1927 - [5.0] add
assume_scheme
to forms.URLField by @asottile in https://github.com/typeddjango/django-stubs/pull/1929 - Fix return type of
BaseModelAdmin.formfield_for_dbfield
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1934 - Revert
pre-commit==3.6.1
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1936 - Fix type hint of
Response.set_cookie.max_age
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1941 - 5.0: Add ChoicesType by @q0w in https://github.com/typeddjango/django-stubs/pull/1942
- Add through_defaults for RelatedManager methods by @mfosterw in https://github.com/typeddjango/django-stubs/pull/1943
- Update type hints of
core.signing
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1945 - [5.0] Update
core.validators
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1947 - [5.0] Update
core.paginator
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1946 - Generic
forms.ModelChoiceField
by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1889 - Support processing of other relations and fields when one is broken by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1877
- Allowing
set
inmodel_to_dict
'sexclude
by @jamesbraza in https://github.com/typeddjango/django-stubs/pull/1952 - [5.0] Add django.db.models.GeneratedField by @palfrey in https://github.com/typeddjango/django-stubs/pull/1944
- Fix type hint of
BaseEngine.template_dirs
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1954 - Update type hints of contrib.auth.hashers by @yhay81 in https://github.com/typeddjango/django-stubs/pull/1955
- deps: Upgrade pre-commit for newer versions of python by @delfick in https://github.com/typeddjango/django-stubs/pull/1961
- 5.0: Add auth.middleware.auser by @q0w in https://github.com/typeddjango/django-stubs/pull/1966
- 5.0: Add ModelAdmin.show_facets by @q0w in https://github.com/typeddjango/django-stubs/pull/1967
- ruff: Fix config warnings by @q0w in https://github.com/typeddjango/django-stubs/pull/1964
- 5.0: Add BaseConstraint.violation_error_code by @q0w in https://github.com/typeddjango/django-stubs/pull/1969
- 5.0: Add Signal.asend and Signal.asend_robust by @q0w in https://github.com/typeddjango/django-stubs/pull/1965
- 5.0: Add QuerySet.(a)update_or_create new create_defaults arg by @q0w in https://github.com/typeddjango/django-stubs/pull/1970
- 5.0: Add AdminSite.get_log_entries by @q0w in https://github.com/typeddjango/django-stubs/pull/1963
- 5.0: Add gis ClosestPoint by @q0w in https://github.com/typeddjango/django-stubs/pull/1968
- 5.0: Rename save_existing arg instance to obj by @q0w in https://github.com/typeddjango/django-stubs/pull/1971
- 5.0: Remove admin.helpers.checkbox by @q0w in https://github.com/typeddjango/django-stubs/pull/1972
- 5.0: Change annotation_select_mask from set[str] to list[str] by @q0w in https://github.com/typeddjango/django-stubs/pull/1973
- fixup: Pass violation_error_code to init by @q0w in https://github.com/typeddjango/django-stubs/pull/1975
- Avoid returning None from get_field_related_model_cls by @SingingTree in https://github.com/typeddjango/django-stubs/pull/1956
- 5.0: Pass positional args name and violation_error_message to BaseConstraint by @q0w in https://github.com/typeddjango/django-stubs/pull/1974
- 5.0: Remove pytz support by @q0w in https://github.com/typeddjango/django-stubs/pull/1980
- 5.0: Remove global setting USE_L10N by @q0w in https://github.com/typeddjango/django-stubs/pull/1979
- 5.0: Remove OSMGeoAdmin, GeoModelAdmin by @q0w in https://github.com/typeddjango/django-stubs/pull/1981
- 5.0: Remove extra_tests arg for DiscoverRunner.build_suite/run_tests by @q0w in https://github.com/typeddjango/django-stubs/pull/1978
- 5.0: Remove django.utils baseconv and datetime_safe modules by @q0w in https://github.com/typeddjango/django-stubs/pull/1977
- 5.0: Add request arg to ModelAdmin.lookup_allowed by @q0w in https://github.com/typeddjango/django-stubs/pull/1976
- Add URL converter protocol type by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1984
- Fix type annotation for RegisterLookupMixin.class_lookups by @avoronov-box in https://github.com/typeddjango/django-stubs/pull/1962
- Update django to 5.0.3 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1990
- Remove some deprecated Django 3.x APIs by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1991
- Fix BaseModelAdmin.view_on_site annotation by @cuu508 in https://github.com/typeddjango/django-stubs/pull/1993
- Allow immutable
extra_context
onTemplateView
s by @samueljsb in https://github.com/typeddjango/django-stubs/pull/1994 - Add BoundField.html() by @pelme in https://github.com/typeddjango/django-stubs/pull/1999
- Allow timedelta type for session.set_expiry() argument by @mlazar-endear in https://github.com/typeddjango/django-stubs/pull/2001
- Bump
pytest-mypy-plugins
to 3.1.1 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2003 - Update mypy, add a bit more metadata by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1997
- 5.0: Update
django.contrib.auth
by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2009 - 5.0: Update
django.conf
by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2008 - 5.0: Update
django.views
by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2007 - 5.0: Update
django.test
by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2005 - 5.0: Update
django.utils
by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2006 - Specify d.c.serializers.base.DeserializedObject.object type by @j00bar in https://github.com/typeddjango/django-stubs/pull/2010
- Clean the cache on each run of
stubtest
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2015 - Keep abstract Django models internally in the plugin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2017
- Add GitHub actions release workflow by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1950
- Adding missing
Q
methods:check()
,flatten()
by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1899 - Improve types in
utils.termcolors
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1901 - Set the calculated metaclass when creating type info in the plugin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2025
- Do not annotate MRs with pyright by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2023
- Use
MRI_MYPY
inget_additional_deps
hook by @sobolevn in https://github.com/typeddjango/django-stubs/pull/2024 - Update
_default_manager
and_base_manager
to beManager
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2022 - Determine the type of queryset methods on unions by @delfick in https://github.com/typeddjango/django-stubs/pull/2027
- Add first stub for get_model_admin by @nebiyuelias1 in https://github.com/typeddjango/django-stubs/pull/2029
- 5.0: Update
django.contrib.admin
by @ngnpope in https://github.com/typeddjango/django-stubs/pull/2004 - [5.0] Update
core.files
by @Viicos in https://github.com/typeddjango/django-stubs/pull/1949 - [5.0] Update
core.cache.backends
, addRedisCache
and related classes by @Viicos in https://github.com/typeddjango/django-stubs/pull/1948 - Fix
AsyncClient.defaults
attribute typing by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1878 - Relax type for
fields
argument ofModel.refresh_from_db()
by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2035 - [5.0] Add missing stubs for geos by @nebiyuelias1 in https://github.com/typeddjango/django-stubs/pull/2034
- Make
AdminSite.get_model_admin
generic by @Viicos in https://github.com/typeddjango/django-stubs/pull/2038 - [5.0] Add
db_default=
parameter to modelsField
classes by @Skorpyon in https://github.com/typeddjango/django-stubs/pull/1876 - Remove
class Meta
fromModel
andForm
class stubs by @jorenham in https://github.com/typeddjango/django-stubs/pull/2000 - Add datetime.timedelta as valid type for HttpRequest.get_signed_cookie() max_age argument. by @pelme in https://github.com/typeddjango/django-stubs/pull/2045
- CI: Update Django 4.2 version used for test suite by @intgr in https://github.com/typeddjango/django-stubs/pull/2049
- Refine return type for
ManyToOneRel.get_accessor_name()
by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2052 - Add
DeferredAttribute.__get__()
by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2050 - Add missing methods and superclass to
FieldFile
by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2051 - Add
db_comment=
parameter to Postgres and GIS model fields by @saJaeHyukc in https://github.com/typeddjango/django-stubs/pull/2054 - Correct type for
db.models.sql.query.Query.join()
argument by @mthuurne in https://github.com/typeddjango/django-stubs/pull/2055 - 5.0: Update
django.db.backends.oracle.base
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2057 - 5.0: Update
django.test.client
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2059 - 5.0: Update
django.test.html
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2060 - 5.0: Update
django.test.runner
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2061 - 5.0: Update
django.template
,django.templatetags
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2063 - 5.0: Update
django.test.testcases
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2062 - 5.0: Update
django.http
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2064 - 5.0: Update
django.core.management
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2067 - 5.0: Update
django.core.handlers
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2066 - 5.0: Update
django.contrib.sessions.serializers
,django.core.serializers
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2068 - Update django app related types by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2071
- Add a
returncode
attribute toCommandError
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2072 - Disable mypy
ignore_missing_imports
option by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2058 - fix typing for URL validator.call by @asottile in https://github.com/typeddjango/django-stubs/pull/2074
- Use field generic types for descriptors by @md384 in https://github.com/typeddjango/django-stubs/pull/2048
- 5.0: Update
django.core.servers.basehttp
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2070 - Update
django.template.base.Template.render()
argument type by @Majsvaffla in https://github.com/typeddjango/django-stubs/pull/1160 - 5.0: Add
django.utils.choices
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2075 - 5.0: Update
django.contrib.sitemaps
,django.contrib.staticfiles
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2076 - Update pyright report options (
reportMissingTypeArgument
,reportPrivateUsage
) by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2077 - 5.0: Update
django.contrib.postgres
by @sudosubin in https://github.com/typeddjango/django-stubs/pull/2078 - Add
path
signature for async views by @jlost in https://github.com/typeddjango/django-stubs/pull/2085 - Remove incorrect
Reversible
base class fromQuerySet
by @intgr in https://github.com/typeddjango/django-stubs/pull/2094 - Version 5.0.0 release (django-stubs, django-stubs-ext) by @flaeppe in https://github.com/typeddjango/django-stubs/pull/2087
New Contributors
- @Viicos made their first contribution in https://github.com/typeddjango/django-stubs/pull/1866
- @dephiros made their first contribution in https://github.com/typeddjango/django-stubs/pull/1873
- @jamesbraza made their first contribution in https://github.com/typeddjango/django-stubs/pull/1927
- @mfosterw made their first contribution in https://github.com/typeddjango/django-stubs/pull/1943
- @palfrey made their first contribution in https://github.com/typeddjango/django-stubs/pull/1944
- @yhay81 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1955
- @delfick made their first contribution in https://github.com/typeddjango/django-stubs/pull/1961
- @SingingTree made their first contribution in https://github.com/typeddjango/django-stubs/pull/1956
- @avoronov-box made their first contribution in https://github.com/typeddjango/django-stubs/pull/1962
- @cuu508 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1993
- @samueljsb made their first contribution in https://github.com/typeddjango/django-stubs/pull/1994
- @pelme made their first contribution in https://github.com/typeddjango/django-stubs/pull/1999
- @mlazar-endear made their first contribution in https://github.com/typeddjango/django-stubs/pull/2001
- @j00bar made their first contribution in https://github.com/typeddjango/django-stubs/pull/2010
- @jorenham made their first contribution in https://github.com/typeddjango/django-stubs/pull/2019
- @fidoriel made their first contribution in https://github.com/typeddjango/django-stubs/pull/1925
- @armanckeser made their first contribution in https://github.com/typeddjango/django-stubs/pull/2021
- @nebiyuelias1 made their first contribution in https://github.com/typeddjango/django-stubs/pull/2029
- @Skorpyon made their first contribution in https://github.com/typeddjango/django-stubs/pull/1876
- @saJaeHyukc made their first contribution in https://github.com/typeddjango/django-stubs/pull/2054
- @sudosubin made their first contribution in https://github.com/typeddjango/django-stubs/pull/2057
- @md384 made their first contribution in https://github.com/typeddjango/django-stubs/pull/2048
- @Majsvaffla made their first contribution in https://github.com/typeddjango/django-stubs/pull/1160
- @jlost made their first contribution in https://github.com/typeddjango/django-stubs/pull/2085
Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.7...5.0.0
v4.2.7
Headline changes
- mypy 1.7: Recommended mypy version updated to 1.7.x
- Improved type inference for
ManyToManyField
andModel.<manytomany>.through
- If you previously imported
RelatedManager
orManyRelatedManager
, update those to django-stubs-ext:from django_stubs_ext.db.models.manager import ManyRelatedManager, RelatedManager
- It's now allowed to override Django's
@cached_property
properties with class variables or@property
properties. - Even though Django 5.0 was released yesterday, this version does not yet include any changes specific to Django 5.0.
Plugin improvements
- Improved
ManyToManyDescriptor
and fixedModel.<manytomany>.through
typing by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1805 - Fixed
Self
-typed custom queryset methods to be compatible withQuerySet
by @moranabadie in https://github.com/typeddjango/django-stubs/pull/1852
django-stubs-ext
- django-stubs-ext: Export
RelatedManager
,ManyRelatedManager
stub-only classes by @intgr in https://github.com/typeddjango/django-stubs/pull/1834 - Updated
TypedModelMeta
ordering
attribute to allowOrderBy
objects by @HansAarneLiblik in https://github.com/typeddjango/django-stubs/pull/1847
Stubs fixes
- Added missing
search_help_text=
parameter toChangeList.__init__()
by @quinox in https://github.com/typeddjango/django-stubs/pull/1801 - Allow additional types for SQL parameters in
migrations.RunSQL()
by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1803 - Allow custom Form class in
SuccessMessageMixin.form_valid()
by @SukiCZ in https://github.com/typeddjango/django-stubs/pull/1812 - Fixed
db_comment=
parameter position fordjango.db.models.Field.__init__()
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1815 - Added missing
RelatedField.__init__()
method and removedForeignObject.__init__(db_constraint=)
parameter in Field constructors by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1816 - Fixed argument types of
assertNumQueries()
andassertQuerySetEqual()
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1823 - Fixed
get_deleted_objects()
return fromlist[Model]
->list[str]
by @golgor in https://github.com/typeddjango/django-stubs/pull/1825 - Removed incorrect
django.db.models
re-exports by @intgr in https://github.com/typeddjango/django-stubs/pull/1835 - Fixed
TemplateResponse.cookies
attribute andSimpleCookie
type by @apollo13 in https://github.com/typeddjango/django-stubs/pull/1702
Stubs improvements
- Added stubs for
django.contrib.postgres.expressions
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1765 - Improved hints of
django.contrib.gis.gdal.libgdal
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1811 - Simulate
@deconstructible
as a mixin class by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1818 - Improved types for
django.db.models.enums.*
modules by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1819 - Added
BaseExpression.contains_subquery()
method (update to Django 4.2.7) by @intgr in https://github.com/typeddjango/django-stubs/pull/1827 - Improved types for multiple methods of
QuerySet
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1822 - Improved
Collector
andNestedObjects
attributes, methods by @intgr in https://github.com/typeddjango/django-stubs/pull/1826 - Added
django.db.models.functions.MD5()
database function by @kevinmarsh in https://github.com/typeddjango/django-stubs/pull/1830 - Constrained multiple
BaseModelAdmin
attributes to be either list or tuple by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1832 - Constrained multiple
BaseModelAdmin
methods to return either list or tuple by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1833 - Accurately infer
capfirst()
None
return by @intgr in https://github.com/typeddjango/django-stubs/pull/1842 - Various improvements in
django.core.management.commands
modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1829 - Added
Model._do_update()
method signature by @pfouque in https://github.com/typeddjango/django-stubs/pull/1854
Stubs improvements: @cached_property
- Reuse
functools.cached_property
definition instead of defining our own by @intgr in https://github.com/typeddjango/django-stubs/pull/1771 - Updated
@property
attributes to@cached_property
part 1 by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1761 - Updated
@property
attributes to@cached_property
part 2 by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1768 - Updated Expression classes
output_field
to@cached_property
orClassVar
and improves type by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1769
Housekeeping
- Moved plugin generated
<Model>_RelatedManager
entries to allowlist by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1806 - Moved
RelatedManager
todjango.db.models.fields.related_descriptors
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1814 - Restored
RelatedManager
,ManyRelatedManager
to inherit fromManager
notBaseManager
by @intgr in https://github.com/typeddjango/django-stubs/pull/1843 - Upgraded to mypy 1.7.0 by @intgr in https://github.com/typeddjango/django-stubs/pull/1837
- Unify plugin check for model type info by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1853
- Version 4.2.7 release (django-stubs, django-stubs-ext) by @intgr in https://github.com/typeddjango/django-stubs/pull/1856
New Contributors
- @SukiCZ made their first contribution in https://github.com/typeddjango/django-stubs/pull/1812
- @golgor made their first contribution in https://github.com/typeddjango/django-stubs/pull/1825
- @HansAarneLiblik made their first contribution in https://github.com/typeddjango/django-stubs/pull/1847
- @apollo13 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1702
- @pfouque made their first contribution in https://github.com/typeddjango/django-stubs/pull/1854
Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.6...4.2.7
v4.2.6
Headline changes
-
Fixed several bugs in version 4.2.5. Thanks to everyone for contributing fixes on a short order!
-
Removed direct mypy dependency. If you are using mypy, please add an explicit
mypy
dev dependency to your project, or install django-stubs with the extradjango-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.
Plugin fixes
- Fixed
as_manager()
andfrom_queryset()
when combined withSelf
types (#1788) by @moranabadie in https://github.com/typeddjango/django-stubs/pull/1789 - Fix IndexError crash when using
from_queryset()
of custom Manager subclass by @moranabadie in https://github.com/typeddjango/django-stubs/pull/1786 - Revert "Use
parse_bool
implementation from mypy" by @intgr in https://github.com/typeddjango/django-stubs/pull/1792 (Turns out this was not necessary and will be reverted)
Stubs fixes
- Fixed
Field.formfield()
,GeometryField.formfield()
method arguments by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1778
Stubs improvements
- Various improvements in
django.core.management
modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1787 - Various improvments in
django.db.backend.base
modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1791
Housekeeping
- Drop hard dependency on mypy by @intgr in https://github.com/typeddjango/django-stubs/pull/1782
- Version 4.2.6 release (django-stubs only) by @intgr in https://github.com/typeddjango/django-stubs/pull/1794
Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.5...4.2.6
v4.2.5
Headline changes
-
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 extradjango-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
Stubs fixes
- Made
default_storage
produce aStorage
object by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1665 - Fixed wrong type hints for
SyndicationFeed
methods by @WhyNotHugo in https://github.com/typeddjango/django-stubs/pull/1705 - Fixed variance of
Migration.operations
attribute by @asottile in https://github.com/typeddjango/django-stubs/pull/1707 - Fixed variance of all
Migration
list attributes by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1710 - Adjust
bases=
parameter inCreateModel
migration op to allow for mixins by @asottile in https://github.com/typeddjango/django-stubs/pull/1708 - Fixed
_Composable
protocol for compatibility withpsycopg2-stubs
change by @andersk in https://github.com/typeddjango/django-stubs/pull/1714 - Various fixes and improvements in
django.views
modules by @GabDug in https://github.com/typeddjango/django-stubs/pull/1716 - Removed
null
andvalidators
arguments fromManyToManyField.__init__
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1720 - Various fixes and improvements in
django.test
modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1752 - Fixed
BaseModelForm
,ErrorList
,ErrorDict
constructorrenderer=
parameter by @GabDug in https://github.com/typeddjango/django-stubs/pull/1690
Stubs improvements
- Annotated return value of all
deconstruct
methods by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1695 - Added missing arguments to
SQLCompiler
methods by @ashm-tech in https://github.com/typeddjango/django-stubs/pull/1689 - Added missing
max_length
attribute toforms.FileField
by @GabDug in https://github.com/typeddjango/django-stubs/pull/1715 - Added missing type arguments to various generic classes by @GabDug in https://github.com/typeddjango/django-stubs/pull/1717
- Added missing
Layer.num_feat
attribute (GeoDjango) by @niconoe in https://github.com/typeddjango/django-stubs/pull/1722 - Specify
AbstractBaseUser.REQUIRED_FIELDS
asClassVar
by @WhyNotHugo in https://github.com/typeddjango/django-stubs/pull/1737 - Improve
fields.Field.formfield()
method by @WhyNotHugo in https://github.com/typeddjango/django-stubs/pull/1739 - Added
ModelStateFieldsCacheDescriptor.__get__
method by @asottile in https://github.com/typeddjango/django-stubs/pull/1743 - Update
Model._meta
toClassVar[Options[Self]]
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1732 - Improved
django.test.signals
types by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1751 - Updated Django to 4.2.6 and updated stubs by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1757
- Require 1 callable argument for
@cached_property
decorated method by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1766 - Allow
psycopg2.sql.SQL
inQuerySet.raw()
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1767 - Added missing stubs in
django.middleware.csrf
module by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1770 - Various improvements in
django.core.cache
modules by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1774 - Improved
Field.formfield()
,GeometryField.formfield()
methods by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1724 - Fixed query
F.resolve_expression()
return type by @schinckel in https://github.com/typeddjango/django-stubs/pull/1659
Plugin improvements
- Resolve dynamic
Manager
methods through manager MRO by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1701 - Use
functools.cached_property
instead of Django's in mypy plugin by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1721 - Improved hints for
ReverseOneToOneDescriptor
and start using it by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1733 - Add better support for
ManyToManyField
'sthrough
model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1719 - Resolve any
settings.AUTH_USER_MODEL
used asto=
in relation by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1746 - Added missing
_default_manager
symbol to generatedthrough
model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1745
Plugin crash fixes
- Gracefully handle unwanted types when creating fallback managers by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1728
Fixes some
AssertionError
crashes. - Handle mismatching types in queryset method resolving gracefully by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1727
Fixes some
AssertionError
crashes. - Fixed crash on bad arguments for model relationship fields by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1735
Fixes some
ValueError
crashes.
Documentation
- Fixed link to
django_stubs_ext
by @tony in https://github.com/typeddjango/django-stubs/pull/1747 & https://github.com/typeddjango/django-stubs/pull/1748 - Add version 4.2.4 to version compatibility table by @intgr in https://github.com/typeddjango/django-stubs/pull/1758
Housekeeping
- Removed a bunch of unused code by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1687
- Removed redefinition of inherited
deconstruct
methods. by @brianhelba in https://github.com/typeddjango/django-stubs/pull/1693 & https://github.com/typeddjango/django-stubs/pull/1694 - Use
parse_bool
implementation from mypy by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1703 - Specify error codes in
# type: ignore
comments for plugin code by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1726 - Specify error codes in
# type: ignore
comments in stubs files by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1734 - CI: Enable testing with Python 3.12 by @intgr in https://github.com/typeddjango/django-stubs/pull/1759
- Bump mypy from 1.5.1 to 1.6.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1764
- Tests: Add mypy error codes to typecheck by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1773
- chore: Migrate from flake8 to ruff by @GabDug in https://github.com/typeddjango/django-stubs/pull/1718
- Update black version by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1776
- Added test to verify that
Manager.from_queryset()
handles invalid argument types by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1731 - Version 4.2.5 release (django-stubs, django-stubs-ext) by @intgr in https://github.com/typeddjango/django-stubs/pull/1777
New Contributors
- @ashm-tech made their first contribution in https://github.com/typeddjango/django-stubs/pull/1689
- @WhyNotHugo made their first contribution in https://github.com/typeddjango/django-stubs/pull/1705
- @niconoe made their first contribution in https://github.com/typeddjango/django-stubs/pull/1722
- @schinckel made their first contribution in https://github.com/typeddjango/django-stubs/pull/1659
Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.4...4.2.5
v4.2.4
Most important changes:
- This version add Mypy
1.5.*
support and update[compatible-mypy]
extra to use1.5.*
. - We also update our stubs to be compatible with Django
4.2.5
(and all prior versions of4.2
). -
django_stubs_ext/
folder was renamed to be justext/
, it should not affect users (unless you install it from git) - We no longer assume the
objects
attribute to be present on generic Model classes. As per the django documentation, code working with generic models should use the_default_manager
attribute instead.
This time there is no corresponding release of django-stubs-ext
.
Plugin changes
- We now forbid to instantiate abstract models https://github.com/typeddjango/django-stubs/pull/1663 @flaeppe
- Manager attributes are now
ClassVar
s https://github.com/typeddjango/django-stubs/pull/1672 @flaeppe
Thanks a lot to all contributors and maintainers!
v4.2.3
This version fixes two regressions in previons django-stubs
release and also a few other fixes and improvements. Special thanks to @GabDug for contributing regression fixes on a short order.
This time there is no corresponding release of django-stubs-ext
.
Stubs fixes
- Fixed type error when subclassing
AppConfig
and assigning string todefault_auto_field
by @GabDug in https://github.com/typeddjango/django-stubs/pull/1596 - Fixed type error when subclassing
MiddlewareMixin.__call__()
and usingreturn self.get_response()
by @GabDug in https://github.com/typeddjango/django-stubs/pull/1595 - Allow
None
asredirect_field_name
value for@user_passes_test
and@login_required
decorators by @JoeHitchen in https://github.com/typeddjango/django-stubs/pull/1600
Plugin fixes
- Fixed long-standing issue with
Date(Time)Field
when using mypy settingdisallow_any_explicit
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1599
Stubs changes
- Added
BigIntegerField.MAX_BIGINT
attribute by @asottile in https://github.com/typeddjango/django-stubs/pull/1598 - Improved Jinja2 types and updated
pytest-mypy-plugins
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1601
CI/Testing
- Run tests in multiple shards and all Python versions by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1603
Housekeeping
- Converted
_typeshed.Self
usages totyping_extensions.Self
(PEP 673) by @intgr in https://github.com/typeddjango/django-stubs/pull/1591 - Version 4.2.3 release (django-stubs only) by @intgr in https://github.com/typeddjango/django-stubs/pull/1604
New Contributors
- @JoeHitchen made their first contribution in https://github.com/typeddjango/django-stubs/pull/1600
Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.2...4.2.3
v4.2.2
Headline changes
-
mypy 1.4: Recommended mypy version updated to 1.4.x
-
Support for
django-split-settings
,django-configurations
and other Django settings addons withstrict_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.
Django 4.2 changes
- Applied Django 4.2 deprecations by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1523
- Updated global settings and
AppConfig
class to match Django 4.2 by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1524 - Added types for new 'system checks' in Django 4.2 by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1526
- Added
ManifestStaticFilesStorage
new parameters by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1528 - Added new methods to
Sitemap
class by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1527 - Added new
headers=
parameter to(Async)RequestFactory
and(Async)Client
classes by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1529- Additional fixes by @intgr in https://github.com/typeddjango/django-stubs/pull/1537
- GDAL-related GeoDjango updates in Django 4.2 by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1525
- Added ORM
^
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/1536 - Added and updated
db.backends
DatabaseIntrospection
andDatabaseOperations
classes by @GabDug in https://github.com/typeddjango/django-stubs/pull/1571
Stubs additions
- Added
QuerySet._result_cache
attribute and_fetch_all()
method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1505 - Added
ModelAdmin.search_help_text
attribute by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1546 - Added email console handler
EmailBackend.write_message()
method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1547 - Added
ModelAdmin.get_formset_kwargs()
method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1545 - Added
Signal._live_receivers()
method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1551 - Added
SQLCompiler._order_by_pairs()
method by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1586 - Added
memcache_key_warnings()
function by @rvanlaar in https://github.com/typeddjango/django-stubs/pull/1562
Stubs fixes
- Fixed
create_model_instance
incorrect data argument type by @namper in https://github.com/typeddjango/django-stubs/pull/1521 - Marked
RequestSite.{save,delete}
methods asNoReturn
since they always raise by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1530 - Updated
SafeExceptionReporterFilter
attributes and removed obsoleteCLEANSED_SUBSTITUTE
by @mthuurne in https://github.com/typeddjango/django-stubs/pull/1540 - Changed
AppConfig.default_auto_field
to attribute instead of method by @mthuurne in https://github.com/typeddjango/django-stubs/pull/1541 - Fixed
default_error_messages
attribute type of baseField
andGenericIPAddressField
classes by @asottile in https://github.com/typeddjango/django-stubs/pull/1538 - Improved spatialite
DatabaseWrapper
attributes by @filbasi in https://github.com/typeddjango/django-stubs/pull/1544 - Improved types for Signal
dispatch.dispatcher
by @GabDug in https://github.com/typeddjango/django-stubs/pull/1567 - Accept
str
field names forWindow.order_by()
, allowNone
forasc/desc
arguments by @GabDug in https://github.com/typeddjango/django-stubs/pull/1574 - Updated many
django.utils.*
types from stubtest by @GabDug in https://github.com/typeddjango/django-stubs/pull/1575 - Updated many
db.migrations.operations
types from stubtest by @GabDug in https://github.com/typeddjango/django-stubs/pull/1583 - Added
StepValueValidator
, fixed argument forSRIDCacheEntry
/EmailValidator
, improvedurls.resolvers
types by @GabDug in https://github.com/typeddjango/django-stubs/pull/1589
Plugin changes
- Fixed
ForeignKey
queryset filters on un-swapped models by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1495 - Add
strict_settings
option, allow runtime fallbacks for custom settings by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1557- Add "Settings" section to README by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1581
- Automatically reset mypy cache when plugin settings change by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1578
- Fixed unhandled exception
KeyError: 'model_bases'
and related errors by @intgr in https://github.com/typeddjango/django-stubs/pull/1563
django-stubs-ext
- Added
TypedDatabaseRouter
as database router base class by @intgr in https://github.com/typeddjango/django-stubs/pull/1522
CI/testing
- CI: Replace isort with Ruff import sorting by @intgr in https://github.com/typeddjango/django-stubs/pull/1507
- CI: Auto-remove unused imports using Ruff by @intgr in https://github.com/typeddjango/django-stubs/pull/1508
- CI: Enable Ruff pyupgrade fixes by @intgr in https://github.com/typeddjango/django-stubs/pull/1509
- CI: Run django-stubs-ext tests in full build matrix by @intgr in https://github.com/typeddjango/django-stubs/pull/1552
- Remove typecheck test and clean things up by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1556
- Add stubtest with lots of errors (currently) by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1560
- Removed extra
--generate-allowlist
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1576
- Removed extra
Housekeeping
- Removed unsupported Django versions from package classifiers by @intgr in https://github.com/typeddjango/django-stubs/pull/1553
- Removed try-except around import of
ArrayField
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1558- Reverted: Fix crash when psycopg2 is not installed by @intgr in https://github.com/typeddjango/django-stubs/pull/1565
- Removed usage of
mypy_extensions
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1566 - Upgrade to Mypy 1.4.0 by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1572
- Chore: set Black Python target to 3.8+ explicitely by @GabDug in https://github.com/typeddjango/django-stubs/pull/1573
- Update
flake8
plugins by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1579 - CI: Run tests and pre-commit using newest Python version by @intgr in https://github.com/typeddjango/django-stubs/pull/1582
- Removed duplicate "import all" test file by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1587
- Update compatible-mypy to 1.4.x by @intgr in https://github.com/typeddjango/django-stubs/pull/1588
- Version 4.2.2 release (django-stubs, django-stubs-ext) by @intgr in https://github.com/typeddjango/django-stubs/pull/1590
New Contributors
- @namper made their first contribution in https://github.com/typeddjango/django-stubs/pull/1521
- @filbasi made their first contribution in https://github.com/typeddjango/django-stubs/pull/1544
- @GabDug made their first contribution in https://github.com/typeddjango/django-stubs/pull/1567
- @rvanlaar made their first contribution in https://github.com/typeddjango/django-stubs/pull/1562
Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.1...4.2.2
v4.2.1
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 https://github.com/typeddjango/django-stubs/pull/1492 - Improve
core.files.storages
types for Django 4.2 by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1488 - Allow using async
StreamingHttpResponse
by @Alexerson in https://github.com/typeddjango/django-stubs/pull/1484 - Added
robust
parameter totransaction.on_commit()
by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1469
Other stubs additions
- Added set/get typing for spatial Model fields by @martinlehoux in https://github.com/typeddjango/django-stubs/pull/1487
- Made
django.conf
constantsLiteral
s by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1470 - Added
TypedModelMeta
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- Fixed missing
__init__.py
in django_stubs_ext.db by @monosans in https://github.com/typeddjango/django-stubs/pull/1460
- Fixed missing
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 https://github.com/typeddjango/django-stubs/pull/1465 - Fixed
ManyToManyRawIdWidget
to acceptManyToManyRel
argument by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1447 - Fixed
classonlymethod
decorator declaration by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1494 - Fixed type of field attribute descriptors on Model classes (not instance) by @intgr in https://github.com/typeddjango/django-stubs/pull/1491
- Added missing argument default to
admin.sites.get_app_list()
by @AkaZecik in https://github.com/typeddjango/django-stubs/pull/1497 - Updated name of
lookup_needs_distinct()
function by @AkaZecik in https://github.com/typeddjango/django-stubs/pull/1498 - Fixed
_make_token_with_timestamp()
argumentsecret
type by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1462 - Fixed
send_mass_email()
argument type to allowNone
by @dlesbre in https://github.com/typeddjango/django-stubs/pull/1516 - Made
UserCreationForm
generic by @monosans in https://github.com/typeddjango/django-stubs/pull/1518 - Added
SessionBase
methods, improvedSessionStore.get_model_class()
return type by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1517
Other fixes
- Fixed typo in mypy.ini error message by @asottile in https://github.com/typeddjango/django-stubs/pull/1503
Housekeeping
- Added new logo by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1499, https://github.com/typeddjango/django-stubs/pull/1500, https://github.com/typeddjango/django-stubs/pull/1501, https://github.com/typeddjango/django-stubs/pull/1502
- Dropped Python 3.7 compatibility by @intgr in https://github.com/typeddjango/django-stubs/pull/1459
- Dropped Django 4.0 compatibility by @intgr in https://github.com/typeddjango/django-stubs/pull/1468
- Update compatible-mypy & CI to mypy 1.3.0 by @intgr in https://github.com/typeddjango/django-stubs/pull/1496
- CI: Check and fix missing
__init__.py
with flake8-no-pep420 by @intgr in https://github.com/typeddjango/django-stubs/pull/1461 - Tweaked package license metadata and rename files by @intgr in https://github.com/typeddjango/django-stubs/pull/1463
- Version 4.2.1 release (django-stubs, django-stubs-ext) by @intgr in https://github.com/typeddjango/django-stubs/pull/1520
New Contributors
- @Kostia-K made their first contribution in https://github.com/typeddjango/django-stubs/pull/1465
- @andrlik made their first contribution in https://github.com/typeddjango/django-stubs/pull/1492
- @AkaZecik made their first contribution in https://github.com/typeddjango/django-stubs/pull/1497
- @asottile made their first contribution in https://github.com/typeddjango/django-stubs/pull/1503
- @Alexerson made their first contribution in https://github.com/typeddjango/django-stubs/pull/1488
- @dlesbre made their first contribution in https://github.com/typeddjango/django-stubs/pull/1516
Full Changelog: https://github.com/typeddjango/django-stubs/compare/4.2.0...4.2.1
v4.2.0
Headline changes
- New version scheme: django-stubs will now use the same major.minor version number as Django. Our Django support policy remains the same: Older versions are still partially supported, and we will continue supporting them as long as it's not a maintenance burden.
- Django 4.2: This release adds initial support for some new features in 4.2. There is still work to do, feel free to open issues or submit pull requests!
- mypy 1.2.0: Recommended mypy version updated to 1.2.0
- Compatibility: This is the last release to support Python version 3.7 and Django 4.0.
Django 4.2 additions
- Added
django.utils.http.content_disposition_header()
function by @alexmv in https://github.com/typeddjango/django-stubs/pull/1448 - Add stubs for new async
Model
methods by @bigfootjon in https://github.com/typeddjango/django-stubs/pull/1443
Other stubs additions
- Added
Query.join()
method by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1404 - Added
Query.where
attribute by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1407 - Added
Model
methodsdate_error_message()
,get_constraints()
,serializable_value()
,prepare_database_save()
Addedapp_label=
argument toAdminSite.get_app_list()
by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1413 - Added
BaseConstraint.default_violation_error_message
attribute by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1419 - Added
BaseUserCreationForm
class by @monosans in https://github.com/typeddjango/django-stubs/pull/1424 - Improve
Form
,FormSet
,BoundField
,ErrorDict
andErrorList
rendering types. AddedIntegerField.step_size
attribute and argument by @monosans in https://github.com/typeddjango/django-stubs/pull/1427 - Added type
JSONObject.__init__()
constructor by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1430 - Added
RenameIndex
migration from Django 4.1 by @karamanolev in https://github.com/typeddjango/django-stubs/pull/1438 - Added
STORAGES
setting by @federicobond in https://github.com/typeddjango/django-stubs/pull/1439
Stubs fixes
- Allow lazy translation strings for constraint
violation_error_message
arguments, attributes by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1418 - Allow setting
SECRET_KEY
to be str or bytes, addSECRET_KEY_FALLBACKS
, updatePasswordResetTokenGenerator
by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1411 - Allow passing
BaseExpression
toUniqueConstraint.expressions
by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1420 - Allow middlewares to return
StreamingReponse
by @rik in https://github.com/typeddjango/django-stubs/pull/1421 - Removed
Manager.delete()
method which is not accessible onManager
by @mschoettle in https://github.com/typeddjango/django-stubs/pull/1431 - Allow lazy translation strings in email contexts by @realsuayip in https://github.com/typeddjango/django-stubs/pull/1442
- Fixed
aiterator()
method ofQuerySet
andBaseManager
by @kjagiello in https://github.com/typeddjango/django-stubs/pull/1449 - Syndication
Feed
items do not need to beModel
instances by @bigfootjon in https://github.com/typeddjango/django-stubs/pull/1444
Mypy plugin fixes
- Allow custom
Manager
andQuerySet
classes to be inner class ofModel
by @federicobond in https://github.com/typeddjango/django-stubs/pull/1392 - Fixed handling of
ForeignKey
in abstract models when usingto=
with a string reference by @Kircheneer in https://github.com/typeddjango/django-stubs/pull/1436 - Handle repeated field lookups in calls to
QuerySet.values_list()
by @leamingrad in https://github.com/typeddjango/django-stubs/pull/1441 - Handle
Model
relations created withForeignObject
/ForeignObjectRel
by @Photonios in https://github.com/typeddjango/django-stubs/pull/1451
Other improvements
- Don't require
tomli
dependency on Python>=3.11 by @monosans in https://github.com/typeddjango/django-stubs/pull/1423
Tests & CI
- Add tests for
QuerySet.select_related
returning queryset type by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1400 - Add test for overriding User model manager by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1401
- CI: Add Django 4.2 to typecheck and update other Django versions by @intgr in https://github.com/typeddjango/django-stubs/pull/1455
- CI: Stop testing with Python 3.7 by @intgr in https://github.com/typeddjango/django-stubs/pull/1453
- Run CI with Django 4.2 and declare support in package metadata by @intgr in https://github.com/typeddjango/django-stubs/pull/1452
Dependencies
- Sync pre-commit and requirements by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1417
- Update compatible-mypy & CI to mypy 1.2.0 by @intgr in https://github.com/typeddjango/django-stubs/pull/1429
- Bump isort to 5.12.0 by @leamingrad in https://github.com/typeddjango/django-stubs/pull/1440
- Version 4.2.0 release (django-stubs, django-stubs-ext) by @intgr in https://github.com/typeddjango/django-stubs/pull/1458
Deferred for next release
- Added
decorators.AsyncGetResponseCallable
Protocol, but is not yet used anywhere by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1425 - Added
BaseModelMeta
for typing Model inner Meta class by @intgr in https://github.com/typeddjango/django-stubs/pull/1375 - Rename
BaseModelMeta
toTypedModelMeta
and document it by @intgr in https://github.com/typeddjango/django-stubs/pull/1456
New Contributors
- @realsuayip made their first contribution in https://github.com/typeddjango/django-stubs/pull/1418
- @monosans made their first contribution in https://github.com/typeddjango/django-stubs/pull/1424
- @karamanolev made their first contribution in https://github.com/typeddjango/django-stubs/pull/1438
- @Kircheneer made their first contribution in https://github.com/typeddjango/django-stubs/pull/1436
- @kjagiello made their first contribution in https://github.com/typeddjango/django-stubs/pull/1449
- @alexmv made their first contribution in https://github.com/typeddjango/django-stubs/pull/1448
- @bigfootjon made their first contribution in https://github.com/typeddjango/django-stubs/pull/1443
Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.16.0...4.2.0
v1.16.0
What's Changed
This release updates recommended mypy version to 1.1.x.
Stubs fixes
- Annotate
BaseCreateView.object
attribute asModel | None
by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1377 - Fixed
ListFilter.expected_parameters()
return type by @pheki in https://github.com/typeddjango/django-stubs/pull/1373 - Fixed type of
AdminSite.site_url
to allowNone
by @LincolnPuzey in https://github.com/typeddjango/django-stubs/pull/1379 - Fixed
@vary_on_headers()
decorator to preserve decorated function type by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1370
Stubs additions
- Added argument
validate_constraints=
toModel.full_clean()
method by @lklivingstone in https://github.com/typeddjango/django-stubs/pull/1385 - Added
Model.validate_constraints()
method by @OvervCW in https://github.com/typeddjango/django-stubs/pull/1388
Housekeeping
- Update recommended mypy & CI to 1.1.1, update MultiValueDict by @intgr in https://github.com/typeddjango/django-stubs/pull/1391
- Release script: Also clean build directories before a build by @intgr in https://github.com/typeddjango/django-stubs/pull/1378
- Version 1.16.0 release by @intgr in https://github.com/typeddjango/django-stubs/pull/1396
New Contributors
- @pheki made their first contribution in https://github.com/typeddjango/django-stubs/pull/1373
- @LincolnPuzey made their first contribution in https://github.com/typeddjango/django-stubs/pull/1379
- @lklivingstone made their first contribution in https://github.com/typeddjango/django-stubs/pull/1385
- @OvervCW made their first contribution in https://github.com/typeddjango/django-stubs/pull/1388
Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.15.0...1.16.0
v1.15.0
This release updates recommended mypy version to 1.0.x. No changes in Django version compatibility.
Some re-exports that were unintentional have been removed. If you get errors like error: Module "django.core.cache" has no attribute "ConnectionProxy"
(for any import path), you probably need to change the module you are importing e.g. ConnectionProxy from. These re-exports were never intentional and are not stable across Django versions.
In addition to code contributions, I'd like to thank @ngnpope, @sobolevn, @ljodal, @christianbundy, @mschoettle for helping out with reviews.
What's Changed
Fixes
- Fix crash using
.values_list("pk")
on abstract model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1355 - Fixed Collector.data and NestedObjects.data types by @RyanWalker277 in https://github.com/typeddjango/django-stubs/pull/1366
- Update Model subclass DoesNotExist type by @mateenkasim in https://github.com/typeddjango/django-stubs/pull/1364
Django 4.2 compatibility
- Add new names for assert functions from Django 4.2 by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1365
Documentation
- Use supported version in typecheck_tests command in Contributing guide by @adamantike in https://github.com/typeddjango/django-stubs/pull/1251
Housekeeping
- Remove unintentional re-exports by @intgr in https://github.com/typeddjango/django-stubs/pull/1309
- Remove unintentional GeoDjango re-exports by @intgr in https://github.com/typeddjango/django-stubs/pull/1308
- Version 1.15.0 release by @intgr in https://github.com/typeddjango/django-stubs/pull/1371
Dependencies
- Upgrade to Mypy 1.0 by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1360
- Update Black to 23.1.0 and reformat with new style by @intgr in https://github.com/typeddjango/django-stubs/pull/1358
- Bump mypy from 1.0.0 to 1.0.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1369
New Contributors
- @adamantike made their first contribution in https://github.com/typeddjango/django-stubs/pull/1251
- @RyanWalker277 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1366
- @mateenkasim made their first contribution in https://github.com/typeddjango/django-stubs/pull/1364
Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.14.0...1.15.0
v1.14.0
What's Changed
This release updates recommended mypy version to 0.991 and fixes a few regressions in the last release. No changes in Django version compatibility.
In addition to code contributions, I'd like to thank @flaeppe, @ngnpope and @sobolevn who helped out with reviews.
Fixes for regressions from last version
- Fix some errors in GeoDjango stubs by @ciscorn in https://github.com/typeddjango/django-stubs/pull/1335
- Fixes "OGRGeometry" has no attribute "
__iter__
" (not iterable) https://github.com/typeddjango/django-stubs/issues/1333 - Fixes error: "bytes" has no attribute "tobytes" https://github.com/typeddjango/django-stubs/issues/1336
- Fixes "OGRGeometry" has no attribute "
- Allow returning Response from admin @action callbacks by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1331
- Fixes Recent change to admin action decorators bans return values https://github.com/typeddjango/django-stubs/issues/1330
- Allow int, bool for data argument in test.client.Client.get() by @nils-van-zuijlen in https://github.com/typeddjango/django-stubs/pull/1345
- Fixes Recent changes to test.client.Client.get() do not accept valid data types https://github.com/typeddjango/django-stubs/issues/1327
Mypy plugin fixes
- Fix crash when filtering on implicit
pk
field on abstract model by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1328 - Suppress
FieldDoesNotExist
raised from attribute on class definition by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1329 - Fix crash when FK references unknown 'app_label' by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1342
Enhancements
- Support passing lazy strings to utils.text functions by @ds-cbo in https://github.com/typeddjango/django-stubs/pull/1344
- Add PASSWORD_RESET_TIMEOUT_DAYS by @christianbundy in https://github.com/typeddjango/django-stubs/pull/1332
- Improve types of
as_sql()
andas_<engine>()
methods by @intgr in https://github.com/typeddjango/django-stubs/pull/1315
Housekeeping, dependencies
- Update to mypy 0.991 for compatible-mypy & CI by @intgr in https://github.com/typeddjango/django-stubs/pull/1260
- Version 1.14.0 release by @intgr in https://github.com/typeddjango/django-stubs/pull/1343
New Contributors
- @christianbundy made their first contribution in https://github.com/typeddjango/django-stubs/pull/1332
- @ds-cbo made their first contribution in https://github.com/typeddjango/django-stubs/pull/1344
Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.13.2...1.14.0
v1.13.2
What's Changed
Mypy plugin fixes
- Avoid index errors that cause Mypy to raise Internal Error by @jimmylai in https://github.com/typeddjango/django-stubs/pull/1317
Strings/translations
- Enhance support for gettext_lazy in AdminSite and ModelAdmin by @rclement in https://github.com/typeddjango/django-stubs/pull/1296
- Support lazy strings for form errors and ValidationError by @mschoettle in https://github.com/typeddjango/django-stubs/pull/1319
- Add support for send_mail subject using gettext_lazy by @mschoettle in https://github.com/typeddjango/django-stubs/pull/1304
- Add FAQ entry regarding StrPromise to README by @mschoettle in https://github.com/typeddjango/django-stubs/pull/1320
GeoDjango
- GeoDjango spatial reference fixes by @mjakob in https://github.com/typeddjango/django-stubs/pull/1265
- Improve GeoDjango type-hints by @ciscorn in https://github.com/typeddjango/django-stubs/pull/1299
Decorators
- Fix @classproperty decorator by @intgr in https://github.com/typeddjango/django-stubs/pull/1287
- Improve types of
django.contrib.admin.decorators
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1267 - Improve ModelAdmin and decorator hints and attributes, add tests by @intgr in https://github.com/typeddjango/django-stubs/pull/1292
- Improve system check registry hints by @intgr in https://github.com/typeddjango/django-stubs/pull/1249
- Fix override_settings decorator typing by @martinlehoux in https://github.com/typeddjango/django-stubs/pull/1322
Other type stubs changes
- Add LANGUAGE_COOKIE_SECURE setting by @sshishov in https://github.com/typeddjango/django-stubs/pull/1294
- Added types for template.backends.django.Template by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1302
- request arg to shortcuts.render() can be None. by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1305
- Add typing for data parameter in get from RequestFactory, test Client and urlencode by @nils-van-zuijlen in https://github.com/typeddjango/django-stubs/pull/1297
- Type cache delete functions to return bool by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1310
- Allow expressions in CheckConstraint.check by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1219
- Improve some DB expression types by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1243
- Add support for
django.core.cache.backends.memcached.PyMemcacheCache
by @ngnpope in https://github.com/typeddjango/django-stubs/pull/1314
Housekeeping
- Version 1.13.2 release by @intgr in https://github.com/typeddjango/django-stubs/pull/1326
- Used _ContextKeys for context like dicts by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1298
- change render_to_string context type by @mschoettle in https://github.com/typeddjango/django-stubs/pull/1306
- Revert "Used _ContextKeys for context like dicts" by @intgr in https://github.com/typeddjango/django-stubs/pull/1311
CI
- Run apt-get update in CI by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1313
Dependency updates
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1291
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1293
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1301
- Bump black from 22.10.0 to 22.12.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1290
- Bump pre-commit from 2.20.0 to 2.21.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1300
- Bump gitpython from 3.1.29 to 3.1.30 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1303
- Bump pytest from 7.2.0 to 7.2.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1324
- Bump requests from 2.28.1 to 2.28.2 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1321
New Contributors
- @sshishov made their first contribution in https://github.com/typeddjango/django-stubs/pull/1294
- @rclement made their first contribution in https://github.com/typeddjango/django-stubs/pull/1296
- @mschoettle made their first contribution in https://github.com/typeddjango/django-stubs/pull/1304
- @nils-van-zuijlen made their first contribution in https://github.com/typeddjango/django-stubs/pull/1297
- @ciscorn made their first contribution in https://github.com/typeddjango/django-stubs/pull/1299
- @jimmylai made their first contribution in https://github.com/typeddjango/django-stubs/pull/1317
Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.13.1...1.13.2
v1.13.1
What's Changed
- Fix types for sessions by @ljodal in https://github.com/typeddjango/django-stubs/pull/1173
- Add SQLite backend is_in_memory_db() functions by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1218
- Introduce
QuerySetAny
type for QuerySet isinstance checks by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1199 - Add LANGUAGE_COOKIE_* settings by @andersk in https://github.com/typeddjango/django-stubs/pull/1228
- move _default_manager to ModelBase by @clouds56 in https://github.com/typeddjango/django-stubs/pull/1150
- Support more use cases of
gettext_lazy
. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1233 - Prefetch attributes by @g-as in https://github.com/typeddjango/django-stubs/pull/1234
- Typehint common dunder methods by @intgr in https://github.com/typeddjango/django-stubs/pull/1238
- Add Optional to LANGUAGE_COOKIE_SAMESITE by @andersk in https://github.com/typeddjango/django-stubs/pull/1246
- Add django.db.models.query.BaseIterable and subclasses by @joshua-jandyco in https://github.com/typeddjango/django-stubs/pull/1242
- Add Django 4.1 constraints violation_error_message by @martinlehoux in https://github.com/typeddjango/django-stubs/pull/1263
- Type
ModelAdmin.fieldsets
'description' option to supportgettext_lazy
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1268 - Type hint improvements for string promises, manager, query set by @benspaulding in https://github.com/typeddjango/django-stubs/pull/1272
- update django.contrib.messages to use _StrOrPromise by @terencehonles in https://github.com/typeddjango/django-stubs/pull/1274
- Add Django 4.0 trigram word classes by @michael-lazar in https://github.com/typeddjango/django-stubs/pull/1278
Fixes
- Fix hasattr(settings) AssertionError with mypy 0.990 by @intgr in https://github.com/typeddjango/django-stubs/pull/1239
Housekeeping
- Fix stackoverflow badge by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1230
- revert changes in #1252 leaked into master by @hoefling in https://github.com/typeddjango/django-stubs/pull/1255
- Version 1.13.1 release by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1241
Continuous integration
- Enable
pre-commit.ci
by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1222 - Cancel old pipelines by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1226
- Run pre-commit only on pre-commit.ci by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1250
- Run checks against Django 4.1 and Python 3.11 by @michael-k in https://github.com/typeddjango/django-stubs/pull/1223
- Introduce
flake8-pyi
inpre-commit
checks by @hoefling in https://github.com/typeddjango/django-stubs/pull/1253 - Pin flake8-pyi to 22.10.0 by @hoefling in https://github.com/typeddjango/django-stubs/pull/1254
- revert changes done in #1253 that satisfy Y041, disable Y041 rule by @hoefling in https://github.com/typeddjango/django-stubs/pull/1256
- Fix CI: Update flake8-pyi by @intgr in https://github.com/typeddjango/django-stubs/pull/1279
Dependency updates
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1236
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1258
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1275
- [pre-commit.ci] pre-commit autoupdate by @pre-commit-ci in https://github.com/typeddjango/django-stubs/pull/1281
New Contributors
- @clouds56 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1150
- @pre-commit-ci made their first contribution in https://github.com/typeddjango/django-stubs/pull/1236
- @joshua-jandyco made their first contribution in https://github.com/typeddjango/django-stubs/pull/1242
- @martinlehoux made their first contribution in https://github.com/typeddjango/django-stubs/pull/1263
- @benspaulding made their first contribution in https://github.com/typeddjango/django-stubs/pull/1272
- @michael-lazar made their first contribution in https://github.com/typeddjango/django-stubs/pull/1278
Full Changelog: https://github.com/typeddjango/django-stubs/compare/1.13.0...1.13.1
v1.13.0
What's Changed
- Set generic type of SimpleCookie by @w0rp in https://github.com/typeddjango/django-stubs/pull/1018
- Update RunSQL type to include parametrized sql by @lachtanek in https://github.com/typeddjango/django-stubs/pull/1015
- BaseContext.copy by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1012
- Add missing type for TestCase.captureOnCommitCallbacks by @lachtanek in https://github.com/typeddjango/django-stubs/pull/1016
- Fix nullability of blank charfields in values and values_list by @ljodal in https://github.com/typeddjango/django-stubs/pull/1020
- Improved type of template.loader.get_template() by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1011
- Bump black from 22.3.0 to 22.6.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1027
- Fix
logger
type in all modules by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1031 - Support cursor.execute(psycopg2.sql.Composable) by @andersk in https://github.com/typeddjango/django-stubs/pull/1029
- Bump requests from 2.28.0 to 2.28.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1035
- Improved return type of render_to_string(). by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1036
- Resolve all queryset methods on managers as attributes by @ljodal in https://github.com/typeddjango/django-stubs/pull/1028
- Populate model argument for dynamically created managers by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1033
- Fix type stubs for EmptyManager by @ljodal in https://github.com/typeddjango/django-stubs/pull/1039
- Improve stubs with minor fixes by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1038
- Monkeypatch some more generics. by @ngnpope in https://github.com/typeddjango/django-stubs/pull/1050
- Bump pre-commit from 2.19.0 to 2.20.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1057
- Use
_AsSqlType
foras_sql
by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1052 - Made BaseContext setitem and getitem consistant. by @smithdc1 in https://github.com/typeddjango/django-stubs/pull/1040
- Add support for inline
from_queryset
in model classes by @ljodal in https://github.com/typeddjango/django-stubs/pull/1045 - Improve typing for unresolved managers by @ljodal in https://github.com/typeddjango/django-stubs/pull/1044
- Use a more general type for django.core.mail.send_mass_mail's datatuple by @jhhayashi in https://github.com/typeddjango/django-stubs/pull/1062
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1070
- Improve type annotation of DiscoverRunner. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1069
- Fix overloads and remove
PathLike
infinders
by @andersk in https://github.com/typeddjango/django-stubs/pull/1063 - Fix type annotation of message_dict. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1073
- Tighten
management.get_commands
type by @andersk in https://github.com/typeddjango/django-stubs/pull/1074 - Improve stubs for contrib.postgres.operations. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1071
- Improve type for @require_http_methods by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1075
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1076
- Support Lookup generics. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1079
- Fix OutputWrapper.style_func type by @andersk in https://github.com/typeddjango/django-stubs/pull/1080
- Fix type of min_value and max_value on FloatField by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1081
- docs(README): Fix indentation in list and examples by @tony in https://github.com/typeddjango/django-stubs/pull/1083
- Remove trailing whitespace in README to fix CI failure by @andersk in https://github.com/typeddjango/django-stubs/pull/1084
- Fix CI error introduced since Django 4.1 by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1093
- Add preset options list to makemessages command. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1091
- Improve type annotation for RunSQL by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1090
- Fix base_field type for SimpleArrayField by @adnathanail in https://github.com/typeddjango/django-stubs/pull/1097
- Prevent building an editable wheel with setuptools<64 by @andersk in https://github.com/typeddjango/django-stubs/pull/1123
- Improve hints for BaseCache by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1117
- Add HttpResponseBase.contains by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1099
- Add BaseDatabaseWrapper.operators by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1119
- Add SimpleTestCase.assertURLEqual() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1102
- Allow None to be passed to Paginator.get_page by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1101
- Improve types for CheckMessage subclasses by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1107
- Expose HttpResponseBase in django.http by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1121
- Improve types for DiscoverRunner by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1106
- Improve return type for BaseCommand.execute() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1104
- Fix CI by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1108
- Improve type hints for test client response.context by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1100
- Add test client response.redirect_chain by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1124
- Add different signatures for form assertions from Django 4.1 by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1105
- Run stubs self-check on all python versions by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1126
- Add database Field.non_db_attrs by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1125
- Rewrite SessionBase properties to use
@property
by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1129 - Add db Field.flatchoices by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1128
- Add HttpRequest current_app and LANGUAGE_CODE attrs by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1127
- Updating deconstructible by @karolyi in https://github.com/typeddjango/django-stubs/pull/1116
- Type
samesite
values as literals 'Lax', 'Strict' or 'None' by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1110 - Enhance stubs for csrf decorators. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1130
- Return Promise for lazy functions. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/689
- Add async queryset for Django 4.1 by @xncbf in https://github.com/typeddjango/django-stubs/pull/1131
- Add Q.xor by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1133
- Improve database backend types by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1132
- Improve types for QuerySet.contains and bulk_create by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1134
- Fix Manager.contains and bulk_create by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1135
- Add QuerySet.aiter() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1136
- Fix return type for django.shortcuts.render by @SebastiaanZ in https://github.com/typeddjango/django-stubs/pull/1140
- Bump black from 22.6.0 to 22.8.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1141
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1142
- fix type hint for GenericSitemap(info_dict) by @djbrown in https://github.com/typeddjango/django-stubs/pull/1111
- Reflect the deprecation of get_response being None. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1086
- Add django.db.models.functions.Collate by @syre in https://github.com/typeddjango/django-stubs/pull/1143
- Bump pytest from 7.1.2 to 7.1.3 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1144
- Correct EmailMultiAlternatives.body by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1146
- Add type and parameter fields to MediaType by @yrd in https://github.com/typeddjango/django-stubs/pull/1103
- Improve Flake8 config by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1149
- Serialize
RelatedManager
attributes in cache by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1152 - Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1153
- Adjust
choices=
type variance for model fields by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1154 - Broaden type annotation for verbose_name(_plural) to accept lazystr. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1139
- Improve stubs for runserver management command. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1037
- Relax
fields=
arg forrefresh_from_db
to acceptSequence
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1156 - Fix paramters for ParallelTestSuite and RemoteTestRunner. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1072
- Fix unresolved placeholder error during serialization by @ljodal in https://github.com/typeddjango/django-stubs/pull/1161
- Disable fallback to runtime types for Django settings by @andersk in https://github.com/typeddjango/django-stubs/pull/1163
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1164
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1165
- Update mypy to 0.981 by @sobolevn in https://github.com/typeddjango/django-stubs/pull/1167
- Allow Promise to be passed to ArrayField.verbose_name by @ljodal in https://github.com/typeddjango/django-stubs/pull/1168
- Disallow passing bytes for Field verbose_name by @intgr in https://github.com/typeddjango/django-stubs/pull/1170
- Don't allow promise to be passed to ArrayField.name by @ljodal in https://github.com/typeddjango/django-stubs/pull/1171
- Implement support for
<QuerySet>.as_manager()
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1025 - Add SETTINGS_MODULE to Settings and LazySettings by @ljodal in https://github.com/typeddjango/django-stubs/pull/1175
- Fix type of _id when using ForeignKey(to_field=) by @intgr in https://github.com/typeddjango/django-stubs/pull/1176
- Add UUIDField lookup types by @intgr in https://github.com/typeddjango/django-stubs/pull/1178
- Reparametrize managers without explicit type parameters by @ljodal in https://github.com/typeddjango/django-stubs/pull/1169
- Bump mypy from 0.981 to 0.982 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1180
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1181
- Add missing re-export for JSONObject. by @PIG208 in https://github.com/typeddjango/django-stubs/pull/1182
- Update utils.log.log_response type for Django 4.1 by @andersk in https://github.com/typeddjango/django-stubs/pull/1183
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1186
- Bump gitpython from 3.1.27 to 3.1.28 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1185
- Bump black from 22.8.0 to 22.10.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1184
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1188
- Bump gitpython from 3.1.28 to 3.1.29 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1187
- Fix
RelatedManager
not callable by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1191 - Update cache timeout parameters to floats by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1193
- Standardize all context manager exit methods by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1194
- Add hints for instance variables in console.EmailBackend by @leamingrad in https://github.com/typeddjango/django-stubs/pull/1200
- Generic sitemap by @UnknownPlatypus in https://github.com/typeddjango/django-stubs/pull/1198
- Allow
assertQuerysetEqual
to compare with a collection of values by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1201 - Improve type of
TestCase.captureOnCommitCallbacks
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/1202 - Bump pytest-mypy-plugins from 1.10.0 to 1.10.1 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1205
- Bump pytest from 7.1.3 to 7.2.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/1203
- Add auto_now attrs to date and time model fields by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1210
- Add django.db.models.base.model_unpickle by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1209
- Add BaseDetailView.object by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1211
- Add BaseDatabaseSchemaEditor.table_sql() by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1212
- Add lots of missing argument & return type hints by @intgr in https://github.com/typeddjango/django-stubs/pull/1204
- Fixed
F
'sasc
anddesc
args by @g-as in https://github.com/typeddjango/django-stubs/pull/1213 - BaseDeleteView now extends FormMixin by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1215
- Auto-update pre-commit hooks by @github-actions in https://github.com/typeddjango/django-stubs/pull/1216
- Add type hints to all test code by @intgr in https://github.com/typeddjango/django-stubs/pull/1217
- Fill remaining missing hints with Any & disallow partial hints by @intgr in https://github.com/typeddjango/django-stubs/pull/1206
- Remove bad redirect_chain attributes by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1148
- Re-allow expressions in UniqueConstraint by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1220
- Add some types to views by @adamchainz in https://github.com/typeddjango/django-stubs/pull/1221
New Contributors
- @lachtanek made their first contribution in https://github.com/typeddjango/django-stubs/pull/1015
- @smithdc1 made their first contribution in https://github.com/typeddjango/django-stubs/pull/1012
- @ngnpope made their first contribution in https://github.com/typeddjango/django-stubs/pull/1050
- @jhhayashi made their first contribution in https://github.com/typeddjango/django-stubs/pull/1062
- @UnknownPlatypus made their first contribution in https://github.com/typeddjango/django-stubs/pull/1081
- @tony made their first contribution in https://github.com/typeddjango/django-stubs/pull/1083
- @adnathanail made their first contribution in https://github.com/typeddjango/django-stubs/pull/1097
- @karolyi made their first contribution in https://github.com/typeddjango/django-stubs/pull/1116
- @SebastiaanZ made their first contribution in https://github.com/typeddjango/django-stubs/pull/1140
- @djbrown made their first contribution in https://github.com/typeddjango/django-stubs/pull/1111
- @syre made their first contribution in https://github.com/typeddjango/django-stubs/pull/1143
- @yrd made their first contribution in https://github.com/typeddjango/django-stubs/pull/1103
Full Changelog: https://github.com/typeddjango/django-stubs/compare/django-stubs@1.12.0...1.13.0
v1.12.0
What's Changed
- Upgrade mypy support to 0.960 by @DamianZaremba in https://github.com/typeddjango/django-stubs/pull/973
- Fix false positive ModelAdmin.list_display_links=None by @AllexVeldman in https://github.com/typeddjango/django-stubs/pull/964
- Fix AlterModelManagers managers annotation to be [(str, Manager), ...] by @alexdutton in https://github.com/typeddjango/django-stubs/pull/966
- Support content attribute for a Testing Response. by @quinox in https://github.com/typeddjango/django-stubs/pull/968
- Fix BaseModelFormSet.save_m2m: accept
self
by @blueyed in https://github.com/typeddjango/django-stubs/pull/970 - Move mypy version upper bound to a [compatible-mypy] extra by @andersk in https://github.com/typeddjango/django-stubs/pull/979
- Add GitHub release action to upload to PyPI & create GitHub release by @terencehonles in https://github.com/typeddjango/django-stubs/pull/980
- Bump mypy from 0.960 to 0.961 by @dependabot in https://github.com/typeddjango/django-stubs/pull/983
- Improve admin filter types by @adamchainz in https://github.com/typeddjango/django-stubs/pull/984
- remove unneeded submodule (removed in #485) by @terencehonles in https://github.com/typeddjango/django-stubs/pull/982
- Remove coreapi from requirements.txt by @jzmiller1 in https://github.com/typeddjango/django-stubs/pull/987
- Enable GitHub auto generated release notes for GitHub releases by @terencehonles in https://github.com/typeddjango/django-stubs/pull/988
- Bump requests from 2.27.1 to 2.28.0 by @dependabot in https://github.com/typeddjango/django-stubs/pull/990
- Bump actions/setup-python from 3 to 4 by @dependabot in https://github.com/typeddjango/django-stubs/pull/989
- Improve admin filter lookups() return type by @adamchainz in https://github.com/typeddjango/django-stubs/pull/992
- Fix manager types scope by @sterliakov in https://github.com/typeddjango/django-stubs/pull/991
- Add fallback related manager in final iteration of AddRelatedManagers by @aleksanb in https://github.com/typeddjango/django-stubs/pull/993
- Improve hints in migration Operation class by @intgr in https://github.com/typeddjango/django-stubs/pull/996
- Set type of default
django.core.cache.cache
toBaseCache
by @flaeppe in https://github.com/typeddjango/django-stubs/pull/998 - Add Feed to monkeypatch to fix generic issue. by @adambirds in https://github.com/typeddjango/django-stubs/pull/1002
- Emit error and set fallback type for managers that can't be resolved by @flaeppe in https://github.com/typeddjango/django-stubs/pull/999
New Contributors
- @AllexVeldman made their first contribution in https://github.com/typeddjango/django-stubs/pull/964
- @alexdutton made their first contribution in https://github.com/typeddjango/django-stubs/pull/966
- @andersk made their first contribution in https://github.com/typeddjango/django-stubs/pull/979
- @jzmiller1 made their first contribution in https://github.com/typeddjango/django-stubs/pull/987
- @adambirds made their first contribution in https://github.com/typeddjango/django-stubs/pull/1002
Full Changelog: https://github.com/typeddjango/django-stubs/compare/v1.11.0...django-stubs@1.12.0
v1.11.0
- mypy 0.950 support
v1.10.1
v1.10.0
v1.9.0
v1.8.0
v1.7.0
v1.6.0
Configuration
-
If you want to rebase/retry this MR, click this checkbox.
This MR has been generated by Renovate Bot.