github typeddjango/django-stubs 4.2.5

latest releases: 5.0.0, 4.2.7, 4.2.6...
6 months ago

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 extra django-stubs[compatible-mypy].

    Mypy remains the only supported type checker. Improvements for other type checkers may be considered in the future, pull requests welcome. See #1628 for details.

  • Officially added Python 3.12 support

Stubs fixes

  • Made default_storage produce a Storage object by @brianhelba in #1665
  • Fixed wrong type hints for SyndicationFeed methods by @WhyNotHugo in #1705
  • Fixed variance of Migration.operations attribute by @asottile in #1707
  • Fixed variance of all Migration list attributes by @brianhelba in #1710
  • Adjust bases= parameter in CreateModel migration op to allow for mixins by @asottile in #1708
  • Fixed _Composable protocol for compatibility with psycopg2-stubs change by @andersk in #1714
  • Various fixes and improvements in django.views modules by @GabDug in #1716
  • Removed null and validators arguments from ManyToManyField.__init__ by @flaeppe in #1720
  • Various fixes and improvements in django.test modules by @UnknownPlatypus in #1752
  • Fixed BaseModelForm, ErrorList, ErrorDict constructor renderer= parameter by @GabDug in #1690

Stubs improvements

Plugin improvements

  • Resolve dynamic Manager methods through manager MRO by @flaeppe in #1701
  • Use functools.cached_property instead of Django's in mypy plugin by @flaeppe in #1721
  • Improved hints for ReverseOneToOneDescriptor and start using it by @flaeppe in #1733
  • Add better support for ManyToManyField's through model by @flaeppe in #1719
  • Resolve any settings.AUTH_USER_MODEL used as to= in relation by @flaeppe in #1746
  • Added missing _default_manager symbol to generated through model by @flaeppe in #1745

Plugin crash fixes

  • Gracefully handle unwanted types when creating fallback managers by @flaeppe in #1728
    Fixes some AssertionError crashes.
  • Handle mismatching types in queryset method resolving gracefully by @flaeppe in #1727
    Fixes some AssertionError crashes.
  • Fixed crash on bad arguments for model relationship fields by @flaeppe in #1735
    Fixes some ValueError crashes.

Documentation

Housekeeping

New Contributors

Full Changelog: 4.2.4...4.2.5

Don't miss a new django-stubs release

NewReleases is sending notifications on new releases.