Headline changes
- Refactor support for
annotate
to utilisemypy.types.Instance.extra_attrs
by @flaeppe in #2319 - Resolve configured
AUTH_USER_MODEL
with aget_type_analyze_hook
by @flaeppe in #2335
What's Changed
- Fix type hints for
SimpleTestCase
by @flaeppe in #2289 - Check correct model on m2m reverse values/values_list by @flaeppe in #2288
- match Field TypeVar variance in models.fields.related by @asottile in #2292
- try and use named arguments from caller for matching name by @asottile in #2294
- Allow
fields
being anIterable
inbulk_update
by @flaeppe in #2296 - Test usage of
from_queryset
manager as reverse manager by @flaeppe in #2295 - A workaround for #2299 by @sobolevn in #2300
- Run mypy with
--strict
onassert_type
tests by @flaeppe in #2301 - Improve
get_context_object_name
onSingleObjectMixin
andMultipleObjectMixin
by @flaeppe in #2298 - Update pyright to 1.1.374 by @sobolevn in #2305
- Remove
BaseManager.cache
attribute by @flaeppe in #2309 - Loosen bound on
CurrentSiteManager
manager type var by @flaeppe in #2308 - Update build status link for
django-stubs-ext
by @flaeppe in #2310 - Use
Any
forConnectionProxy
attributes by @RealOrangeOne in #2311 - Remove
FieldDoesNotExist
from where it's not present at runtime by @flaeppe in #2313 - Declare
ManyToManyField.description
a_StrOrPromise
by @flaeppe in #2312 - Don't populate a type arg for non generic managers by @flaeppe in #2314
- Fixed bugs with RawQuerySet by @ashm-dev in #2316
- Add Typing for EmailField with Support for String Set and Get Types by @ashm-dev in #2317
- Do
models.Model
adjustments fromget_metaclass_hook
by @flaeppe in #2322 - Bump django from 5.0.7 to 5.0.8 by @sobolevn in #2325
- This PR adds some defaults to stubs with
stubdefaulter
by @sobolevn in #2326 - Add a lot of runtime defaults to stubs with
stubdefaulter
by @sobolevn in #2327 - Fix
tuple[A]
types to betuple[A, ...]
types by @sobolevn in #2328 - Check annotated fields in
<QuerySet>.filter
call by @flaeppe in #2332 - Refactor: Unify plugin check for model type info by @flaeppe in #2286
- Enable
mypy.plugins.proper_plugin
by @flaeppe in #2333 - Use mypy's
make_optional_type
instead of shipping our own by @flaeppe in #2334 - Add arbitrary named arguments to @receiver decorator by @craigds in #2342
- Bump django from 5.0.8 to 5.1 by @Viicos in #2347
- Don't modify return values of manager methods in place, modify a copy instead by @jkaikkosplk in #2345
- [5.1] Add slicing notation to F expressions by @Viicos in #1897
- 5.1: Deprecate CheckConstraint.check by @q0w in #2331
- feat: Add missing stubs by @BradleyKirton in #2348
- Update
utils
by @Viicos in #2352 - Update
contrib.sessions.backends
by @Viicos in #2351 - Update django to 5.1.1 by @sobolevn in #2360
- Allow None return form model Field.formfield() by @adamchainz in #2363
- add cache_name for django 5.1 by @asottile in #2365
- Update Django 4.2 LTS version to 4.2.16 by @intgr in #2369
- Document the release process by @intgr in #2371
- Allow lookups on
.annotate
fields by @sterliakov in #2376 - Break what apparently is a cycle involving custom User model and
QuerySet.as_manager()
by @sterliakov in #2377 - Version 5.1.0 release by @richardebeling in #2374
New Contributors
- @RealOrangeOne made their first contribution in #2311
- @ashm-dev made their first contribution in #2316
- @craigds made their first contribution in #2342
- @jkaikkosplk made their first contribution in #2345
- @BradleyKirton made their first contribution in #2348
- @richardebeling made their first contribution in #2374
Full Changelog: 5.0.4...5.1.0