Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update django.template.base.Template.render() argument type #1160

Merged

Conversation

Majsvaffla
Copy link
Contributor

I have made things!

I have corrected the type definition for the context argument to django.template.base.Template.render. The argument is no longer typed as optional and does no longer accept a dict value.

Related issues

Copy link
Member

@sobolevn sobolevn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am quite unsure what to do.

Removing this completely means that older versions of django become unsupported.

@adamchainz what do you think?

@sobolevn
Copy link
Member

(I meant to click "Comment", not "Approve")

@sobolevn sobolevn self-requested a review September 23, 2022 18:42
@adamchainz
Copy link
Contributor

I'd like to make some hints conditional by Django version, if that could be possible... perhaps the mypy plugin could provide the current version?

@sobolevn
Copy link
Member

As far as I know - custom builtins are not supported. python/mypy#12172

We can do something like:

_DjangoVersion4_1 = _DjangoVersion[4, 1]

Inside our plugin we can return Literal[True] for this using get_type_analyze_hook() from https://mypy.readthedocs.io/en/stable/extending_mypy.html

But, this is quite complex!

@adamchainz
Copy link
Contributor

I was thinking about typing django.VERSION conditionally, so we could use the same syntax as at runtime:

if django.VERSION >= (4 ,1):
    ...  # new stuff
else:
    ...  # old stuff

It seems though that Mypy cannot type narrow on comparisons of literal ints in tuples, like below:

from typing import Literal
from typing_extensions import assert_never

version: tuple[Literal[4], Literal[1]] = (4, 1)

if version >= (4, 1):
    reveal_type(version)
else:
    assert_never(version)

It doesn't work:

$ mypy example.py
example.py:7: note: Revealed type is "Tuple[Literal[4], Literal[1]]"
example.py:9: note: Revealed type is "Tuple[Literal[4], Literal[1]]"
example.py:10: error: Argument 1 to "assert_never" has incompatible type "Tuple[Literal[4], Literal[1]]"; expected "NoReturn"
Found 1 error in 1 file (checked 1 source file)

It seems this limitation also applies to literal ints in general:

from typing import Literal
from typing_extensions import assert_never

version: Literal[4] = 4

if version >= 4:
    reveal_type(version)
else:
    reveal_type(version)
    assert_never(version)

Perhaps the better approach is as you suggested, some alternative true/false constants. Perhaps we fix to the latest version but override that in the plugin based on the installed version of django that we find, or some config.

@sobolevn
Copy link
Member

sobolevn commented Sep 26, 2022

sys.version_info check is hard-coded. This is why I thought about Literal[True] / Literal[False] hacks with analyzed dynamic types.

@ngnpope
Copy link
Contributor

ngnpope commented Oct 31, 2022

Also found this related issue: python/typing#693

Following on from Adam's example, I did note that == and != with a literal number do work as expected:

from typing import Literal
from typing_extensions import assert_never

version: Literal[4] = 4

if version == 4:
    reveal_type(version)
else:
    reveal_type(version)
    assert_never(version)

if version != 4:
    reveal_type(version)
    assert_never(version)
else:
    reveal_type(version)

if version == 4 or version == 5:
    reveal_type(version)
else:
    reveal_type(version)
    assert_never(version)

This yields the following:

mypy test.py 
test.py:7: note: Revealed type is "Literal[4]"
test.py:16: note: Revealed type is "Literal[4]"
test.py:19: note: Revealed type is "Literal[4]"
Success: no issues found in 1 source file

So you could possibly construct something very verbose to achieve this by exposing major and minor versions as independent variables and thrashing out all combinations.

I'm currently looking into whether we can extend mypy to allow for checking additional things as well as sys.version_info when inferring condition values. It looks like it should be relatively straightforward to piggy back off the existing logic and provide a callback... I'll have to have a go.

@adamchainz
Copy link
Contributor

So you could possibly construct something very verbose to achieve this by exposing major and minor versions as independent variables and thrashing out all combinations.

We could also use a single numbers: 41 for Django 4.1, 42 for Django 4.2, etc.

I'm currently looking into whether we can extend mypy to allow for checking additional things as well as sys.version_info when inferring condition values. It looks like it should be relatively straightforward to piggy back off the existing logic and provide a callback... I'll have to have a go.

Sick

@@ -73,7 +73,7 @@ class Template:
engine: Optional[Engine] = ...,
) -> None: ...
def __iter__(self) -> Iterator[Node]: ...
def render(self, context: Optional[Union[Context, Dict[str, Any]]]) -> SafeString: ...
def render(self, context: Context) -> SafeString: ...
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that this has to be compatible with django.template.backends.base._EngineTemplate protocol defined in django-stubs.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, wait. There are two Template classes in Django

django.template.base.Template.render() doesn't support dict, but django.template.backends.django.Template.render() is a wrapper class that does support dict and None.

django.template.backends.django.DjangoTemplates.get_template() wraps the first Template in the latter wrapper class. Confusing!

@intgr
Copy link
Collaborator

intgr commented Nov 4, 2022

Removing this completely means that older versions of django become unsupported.

Note that this is not as bad as it actually looks.

If you get your template via the django.template.loader.get_template() or get_template() method of the template engine, you still get a Template whose render() supports dict and None.

As noted in my other comment:

Oh, wait. There are two Template classes in Django

django.template.base.Template.render() doesn't support dict, but django.template.backends.django.Template.render() is a wrapper class that does support dict and None.

django.template.backends.django.DjangoTemplates.get_template() wraps the first Template in the latter wrapper class. Confusing!

@adamchainz adamchainz mentioned this pull request Nov 8, 2022
@christianbundy
Copy link
Contributor

We could also use a single numbers: 41 for Django 4.1, 42 for Django 4.2, etc.

Yep! Or a NamedTuple if we really needed this specificity:

from typing import Literal, NamedTuple
from typing_extensions import assert_never


class Version(NamedTuple):
    major: Literal[4]
    minor: Literal[1]
    
version = Version(4, 1)

if version.major == 4:
    reveal_type(version.major)
else:
    reveal_type(version.major)
    assert_never(version)

if version.major != 4:
    reveal_type(version.major)
    assert_never(version)
else:
    reveal_type(version.major)

if version.major == 4 or version.major == 5:
    reveal_type(version.major)
else:
    reveal_type(version.major)
    assert_never(version)

Copy link
Contributor

@adamchainz adamchainz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can merge this one now, as in #1095 (comment) we agreed to support just the latest Django version.

@adamchainz
Copy link
Contributor

I opened an issue about conditional types based on Django version: #1244

@sobolevn
Copy link
Member

sobolevn commented Nov 9, 2022

Let's merge it right after 1.13.1 release

@Majsvaffla
Copy link
Contributor Author

I haven't followed along completely but if I understand correctly, I could resolve the conflicts and this is still to be merged?

@sobolevn
Copy link
Member

Yes :)

@Majsvaffla Majsvaffla force-pushed the template-render-argument-type-def branch from 1ea15f8 to 417df16 Compare July 4, 2023 08:46
@flaeppe
Copy link
Member

flaeppe commented Apr 19, 2024

Thanks for the PR and sorry for being so super slow getting it merged

@flaeppe flaeppe merged commit 11a1738 into typeddjango:master Apr 19, 2024
40 checks passed
@intgr intgr changed the title Drop dict and Optional from argument type Update django.template.base.Template.render() argument type Apr 24, 2024
@Majsvaffla Majsvaffla deleted the template-render-argument-type-def branch May 2, 2024 11:20
jooola pushed a commit to libretime/libretime that referenced this pull request May 5, 2024
[![Mend
Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Change | Age | Adoption | Passing | Confidence |
|---|---|---|---|---|---|
| [django-stubs](https://togithub.com/typeddjango/django-stubs)
([changelog](https://togithub.com/typeddjango/django-stubs/releases)) |
`>=1.14.0,<5` -> `>=1.14.0,<6` |
[![age](https://developer.mend.io/api/mc/badges/age/pypi/django-stubs/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/django-stubs/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/django-stubs/4.2.7/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|
[![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/django-stubs/4.2.7/5.0.0?slim=true)](https://docs.renovatebot.com/merge-confidence/)
|

---

### Release Notes

<details>
<summary>typeddjango/django-stubs (django-stubs)</summary>

###
[`v5.0.0`](https://togithub.com/typeddjango/django-stubs/releases/tag/5.0.0)

[Compare
Source](https://togithub.com/typeddjango/django-stubs/compare/4.2.7...5.0.0)

#### Announcements

- `QuerySet` class no longer derives from `Collection`. If you run into
errors like `incompatible type "_QuerySet[User, User]"; expected
"Collection[User]"`, [please read this
announcement](https://togithub.com/typeddjango/django-stubs/discussions/2095).

#### Headline changes

- Remove incorrect `Collection` base class and `__contains__` method
from `QuerySet` by [@&#8203;fidoriel](https://togithub.com/fidoriel) in
[typeddjango/django-stubs#1925
- Pyright joins the workflow in an advisory capacity by
[@&#8203;jorenham](https://togithub.com/jorenham) in
[typeddjango/django-stubs#2019
- feat: Allow setting django_settings_module from env by
[@&#8203;armanckeser](https://togithub.com/armanckeser) in
[typeddjango/django-stubs#2021
- Add `ManyRelatedManager.through` attribute and generic type parameter
by [@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#2026

#### What's Changed

- Make `StrPromise` not inherit from `Sequence[str]` by
[@&#8203;intgr](https://togithub.com/intgr) in
[typeddjango/django-stubs#1841
- Update and prepare for Django 5.0 by
[@&#8203;intgr](https://togithub.com/intgr) in
[typeddjango/django-stubs#1859
- Ensure mypy plugin processes inherited many to many fields by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1864
- Include ModelBase subclasses in plugin base class hook condition by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1863
- \[5.0] Added many new a-prefixed asynchronous methods by
[@&#8203;bigfootjon](https://togithub.com/bigfootjon) in
[typeddjango/django-stubs#1741
- Remove section regarding custom queryset methods from README by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1865
- Fix type of `AppConfig.models_module` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1866
- Allow `None` in settings `MIGRATION_MODULES` dict values by
[@&#8203;asottile](https://togithub.com/asottile) in
[typeddjango/django-stubs#1871
- Add type hints for `JSONField.from_db_value` by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1879
- Fix/pyright unknown by
[@&#8203;dephiros](https://togithub.com/dephiros) in
[typeddjango/django-stubs#1873
- Fix type hints of `converters` in `urls.resolvers` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1892
- Update mypy to 1.8.0 by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1885
- Add `@type_check_only` to all Protocols and known stubs-only classes
by [@&#8203;intgr](https://togithub.com/intgr) in
[typeddjango/django-stubs#1894
- Fix types for UniqueConstraint instantiation by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1880
- Add `ModuleType` as a possible type to `URLResolver.urlconf_name` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1891
- Fix type hint of `URLPattern.default_args` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1895
- Update ruff and silence `PYI046` by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1907
- Use PEP 570 syntax by [@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1908
- Fix readme settings example by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1910
- Fix type hint of `EmailBackend.ssl_keyfile` and
`EmailBackend.ssl_certfile` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1911
- Add type of `django.VERSION` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1916
- Added `CommandParser` to `commands.__init__` by
[@&#8203;jamesbraza](https://togithub.com/jamesbraza) in
[typeddjango/django-stubs#1927
- \[5.0] add `assume_scheme` to forms.URLField by
[@&#8203;asottile](https://togithub.com/asottile) in
[typeddjango/django-stubs#1929
- Fix return type of `BaseModelAdmin.formfield_for_dbfield` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1934
- Revert `pre-commit==3.6.1` by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1936
- Fix type hint of `Response.set_cookie.max_age` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1941
- 5.0: Add ChoicesType by [@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1942
- Add through_defaults for RelatedManager methods by
[@&#8203;mfosterw](https://togithub.com/mfosterw) in
[typeddjango/django-stubs#1943
- Update type hints of `core.signing` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1945
- \[5.0] Update `core.validators` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1947
- \[5.0] Update `core.paginator` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1946
- Generic `forms.ModelChoiceField` by
[@&#8203;UnknownPlatypus](https://togithub.com/UnknownPlatypus) in
[typeddjango/django-stubs#1889
- Support processing of other relations and fields when one is broken by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1877
- Allowing `set` in `model_to_dict`'s `exclude` by
[@&#8203;jamesbraza](https://togithub.com/jamesbraza) in
[typeddjango/django-stubs#1952
- \[5.0] Add django.db.models.GeneratedField by
[@&#8203;palfrey](https://togithub.com/palfrey) in
[typeddjango/django-stubs#1944
- Fix type hint of `BaseEngine.template_dirs` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1954
- Update type hints of contrib.auth.hashers by
[@&#8203;yhay81](https://togithub.com/yhay81) in
[typeddjango/django-stubs#1955
- deps: Upgrade pre-commit for newer versions of python by
[@&#8203;delfick](https://togithub.com/delfick) in
[typeddjango/django-stubs#1961
- 5.0: Add auth.middleware.auser by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1966
- 5.0: Add ModelAdmin.show_facets by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1967
- ruff: Fix config warnings by [@&#8203;q0w](https://togithub.com/q0w)
in
[typeddjango/django-stubs#1964
- 5.0: Add BaseConstraint.violation_error_code by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1969
- 5.0: Add Signal.asend and Signal.asend_robust by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1965
- 5.0: Add QuerySet.(a)update_or_create new create_defaults arg by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1970
- 5.0: Add AdminSite.get_log_entries by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1963
- 5.0: Add gis ClosestPoint by [@&#8203;q0w](https://togithub.com/q0w)
in
[typeddjango/django-stubs#1968
- 5.0: Rename save_existing arg instance to obj by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1971
- 5.0: Remove admin.helpers.checkbox by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1972
- 5.0: Change annotation_select_mask from set\[str] to list\[str] by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1973
- fixup: Pass violation_error_code to init by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1975
- Avoid returning None from get_field_related_model_cls by
[@&#8203;SingingTree](https://togithub.com/SingingTree) in
[typeddjango/django-stubs#1956
- 5.0: Pass positional args name and violation_error_message to
BaseConstraint by [@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1974
- 5.0: Remove pytz support by [@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1980
- 5.0: Remove global setting USE_L10N by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1979
- 5.0: Remove OSMGeoAdmin, GeoModelAdmin by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1981
- 5.0: Remove extra_tests arg for DiscoverRunner.build_suite/run_tests
by [@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1978
- 5.0: Remove django.utils baseconv and datetime_safe modules by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1977
- 5.0: Add request arg to ModelAdmin.lookup_allowed by
[@&#8203;q0w](https://togithub.com/q0w) in
[typeddjango/django-stubs#1976
- Add URL converter protocol type by
[@&#8203;adamchainz](https://togithub.com/adamchainz) in
[typeddjango/django-stubs#1984
- Fix type annotation for RegisterLookupMixin.class_lookups by
[@&#8203;avoronov-box](https://togithub.com/avoronov-box) in
[typeddjango/django-stubs#1962
- Update django to 5.0.3 by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1990
- Remove some deprecated Django 3.x APIs by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1991
- Fix BaseModelAdmin.view_on_site annotation by
[@&#8203;cuu508](https://togithub.com/cuu508) in
[typeddjango/django-stubs#1993
- Allow immutable `extra_context` on `TemplateView`s by
[@&#8203;samueljsb](https://togithub.com/samueljsb) in
[typeddjango/django-stubs#1994
- Add BoundField.**html**() by
[@&#8203;pelme](https://togithub.com/pelme) in
[typeddjango/django-stubs#1999
- Allow timedelta type for session.set_expiry() argument by
[@&#8203;mlazar-endear](https://togithub.com/mlazar-endear) in
[typeddjango/django-stubs#2001
- Bump `pytest-mypy-plugins` to 3.1.1 by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#2003
- Update mypy, add a bit more metadata by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#1997
- 5.0: Update `django.contrib.auth` by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[typeddjango/django-stubs#2009
- 5.0: Update `django.conf` by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[typeddjango/django-stubs#2008
- 5.0: Update `django.views` by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[typeddjango/django-stubs#2007
- 5.0: Update `django.test` by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[typeddjango/django-stubs#2005
- 5.0: Update `django.utils` by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[typeddjango/django-stubs#2006
- Specify d.c.serializers.base.DeserializedObject.object type by
[@&#8203;j00bar](https://togithub.com/j00bar) in
[typeddjango/django-stubs#2010
- Clean the cache on each run of `stubtest` by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#2015
- Keep abstract Django models internally in the plugin by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#2017
- Add GitHub actions release workflow by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1950
- Adding missing `Q` methods: `check()`, `flatten()` by
[@&#8203;Alexerson](https://togithub.com/Alexerson) in
[typeddjango/django-stubs#1899
- Improve types in `utils.termcolors` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1901
- Set the calculated metaclass when creating type info in the plugin by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#2025
- Do not annotate PRs with pyright by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#2023
- Use `PRI_MYPY` in `get_additional_deps` hook by
[@&#8203;sobolevn](https://togithub.com/sobolevn) in
[typeddjango/django-stubs#2024
- Update `_default_manager` and `_base_manager` to be `Manager` by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#2022
- Determine the type of queryset methods on unions by
[@&#8203;delfick](https://togithub.com/delfick) in
[typeddjango/django-stubs#2027
- Add first stub for get_model_admin by
[@&#8203;nebiyuelias1](https://togithub.com/nebiyuelias1) in
[typeddjango/django-stubs#2029
- 5.0: Update `django.contrib.admin` by
[@&#8203;ngnpope](https://togithub.com/ngnpope) in
[typeddjango/django-stubs#2004
- \[5.0] Update `core.files` by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1949
- \[5.0] Update `core.cache.backends`, add `RedisCache` and related
classes by [@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#1948
- Fix `AsyncClient.defaults` attribute typing by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#1878
- Relax type for `fields` argument of `Model.refresh_from_db()` by
[@&#8203;mthuurne](https://togithub.com/mthuurne) in
[typeddjango/django-stubs#2035
- \[5.0] Add missing stubs for geos by
[@&#8203;nebiyuelias1](https://togithub.com/nebiyuelias1) in
[typeddjango/django-stubs#2034
- Make `AdminSite.get_model_admin` generic by
[@&#8203;Viicos](https://togithub.com/Viicos) in
[typeddjango/django-stubs#2038
- \[5.0] Add `db_default=` parameter to models `Field` classes by
[@&#8203;Skorpyon](https://togithub.com/Skorpyon) in
[typeddjango/django-stubs#1876
- Remove `class Meta` from `Model` and `Form` class stubs by
[@&#8203;jorenham](https://togithub.com/jorenham) in
[typeddjango/django-stubs#2000
- Add datetime.timedelta as valid type for
HttpRequest.get_signed_cookie() max_age argument. by
[@&#8203;pelme](https://togithub.com/pelme) in
[typeddjango/django-stubs#2045
- CI: Update Django 4.2 version used for test suite by
[@&#8203;intgr](https://togithub.com/intgr) in
[typeddjango/django-stubs#2049
- Refine return type for `ManyToOneRel.get_accessor_name()` by
[@&#8203;mthuurne](https://togithub.com/mthuurne) in
[typeddjango/django-stubs#2052
- Add `DeferredAttribute.__get__()` by
[@&#8203;mthuurne](https://togithub.com/mthuurne) in
[typeddjango/django-stubs#2050
- Add missing methods and superclass to `FieldFile` by
[@&#8203;mthuurne](https://togithub.com/mthuurne) in
[typeddjango/django-stubs#2051
- Add `db_comment=` parameter to Postgres and GIS model fields by
[@&#8203;saJaeHyukc](https://togithub.com/saJaeHyukc) in
[typeddjango/django-stubs#2054
- Correct type for `db.models.sql.query.Query.join()` argument by
[@&#8203;mthuurne](https://togithub.com/mthuurne) in
[typeddjango/django-stubs#2055
- 5.0: Update `django.db.backends.oracle.base` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2057
- 5.0: Update `django.test.client` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2059
- 5.0: Update `django.test.html` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2060
- 5.0: Update `django.test.runner` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2061
- 5.0: Update `django.template`, `django.templatetags` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2063
- 5.0: Update `django.test.testcases` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2062
- 5.0: Update `django.http` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2064
- 5.0: Update `django.core.management` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2067
- 5.0: Update `django.core.handlers` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2066
- 5.0: Update `django.contrib.sessions.serializers`,
`django.core.serializers` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2068
- Update django app related types by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2071
- Add a `returncode` attribute to `CommandError` by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#2072
- Disable mypy `ignore_missing_imports` option by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2058
- fix typing for URL validator.**call** by
[@&#8203;asottile](https://togithub.com/asottile) in
[typeddjango/django-stubs#2074
- Use field generic types for descriptors by
[@&#8203;md384](https://togithub.com/md384) in
[typeddjango/django-stubs#2048
- 5.0: Update `django.core.servers.basehttp` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2070
- Update `django.template.base.Template.render()` argument type by
[@&#8203;Majsvaffla](https://togithub.com/Majsvaffla) in
[typeddjango/django-stubs#1160
- 5.0: Add `django.utils.choices` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2075
- 5.0: Update `django.contrib.sitemaps`, `django.contrib.staticfiles` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2076
- Update pyright report options (`reportMissingTypeArgument`,
`reportPrivateUsage`) by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2077
- 5.0: Update `django.contrib.postgres` by
[@&#8203;sudosubin](https://togithub.com/sudosubin) in
[typeddjango/django-stubs#2078
- Add `path` signature for async views by
[@&#8203;jlost](https://togithub.com/jlost) in
[typeddjango/django-stubs#2085
- Remove incorrect `Reversible` base class from `QuerySet` by
[@&#8203;intgr](https://togithub.com/intgr) in
[typeddjango/django-stubs#2094
- Version 5.0.0 release (django-stubs, django-stubs-ext) by
[@&#8203;flaeppe](https://togithub.com/flaeppe) in
[typeddjango/django-stubs#2087

#### New Contributors

- [@&#8203;Viicos](https://togithub.com/Viicos) made their first
contribution in
[typeddjango/django-stubs#1866
- [@&#8203;dephiros](https://togithub.com/dephiros) made their first
contribution in
[typeddjango/django-stubs#1873
- [@&#8203;jamesbraza](https://togithub.com/jamesbraza) made their first
contribution in
[typeddjango/django-stubs#1927
- [@&#8203;mfosterw](https://togithub.com/mfosterw) made their first
contribution in
[typeddjango/django-stubs#1943
- [@&#8203;palfrey](https://togithub.com/palfrey) made their first
contribution in
[typeddjango/django-stubs#1944
- [@&#8203;yhay81](https://togithub.com/yhay81) made their first
contribution in
[typeddjango/django-stubs#1955
- [@&#8203;delfick](https://togithub.com/delfick) made their first
contribution in
[typeddjango/django-stubs#1961
- [@&#8203;SingingTree](https://togithub.com/SingingTree) made their
first contribution in
[typeddjango/django-stubs#1956
- [@&#8203;avoronov-box](https://togithub.com/avoronov-box) made their
first contribution in
[typeddjango/django-stubs#1962
- [@&#8203;cuu508](https://togithub.com/cuu508) made their first
contribution in
[typeddjango/django-stubs#1993
- [@&#8203;samueljsb](https://togithub.com/samueljsb) made their first
contribution in
[typeddjango/django-stubs#1994
- [@&#8203;pelme](https://togithub.com/pelme) made their first
contribution in
[typeddjango/django-stubs#1999
- [@&#8203;mlazar-endear](https://togithub.com/mlazar-endear) made their
first contribution in
[typeddjango/django-stubs#2001
- [@&#8203;j00bar](https://togithub.com/j00bar) made their first
contribution in
[typeddjango/django-stubs#2010
- [@&#8203;jorenham](https://togithub.com/jorenham) made their first
contribution in
[typeddjango/django-stubs#2019
- [@&#8203;fidoriel](https://togithub.com/fidoriel) made their first
contribution in
[typeddjango/django-stubs#1925
- [@&#8203;armanckeser](https://togithub.com/armanckeser) made their
first contribution in
[typeddjango/django-stubs#2021
- [@&#8203;nebiyuelias1](https://togithub.com/nebiyuelias1) made their
first contribution in
[typeddjango/django-stubs#2029
- [@&#8203;Skorpyon](https://togithub.com/Skorpyon) made their first
contribution in
[typeddjango/django-stubs#1876
- [@&#8203;saJaeHyukc](https://togithub.com/saJaeHyukc) made their first
contribution in
[typeddjango/django-stubs#2054
- [@&#8203;sudosubin](https://togithub.com/sudosubin) made their first
contribution in
[typeddjango/django-stubs#2057
- [@&#8203;md384](https://togithub.com/md384) made their first
contribution in
[typeddjango/django-stubs#2048
- [@&#8203;Majsvaffla](https://togithub.com/Majsvaffla) made their first
contribution in
[typeddjango/django-stubs#1160
- [@&#8203;jlost](https://togithub.com/jlost) made their first
contribution in
[typeddjango/django-stubs#2085

**Full Changelog**:
typeddjango/django-stubs@4.2.7...5.0.0

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined),
Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you
are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the
rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update
again.

---

- [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check
this box

---

This PR has been generated by [Mend
Renovate](https://www.mend.io/free-developer-tools/renovate/). View
repository job log
[here](https://developer.mend.io/github/libretime/libretime).

<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNy4zMjEuMiIsInVwZGF0ZWRJblZlciI6IjM3LjMyMS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6WyJkZXBlbmRlbmNpZXMiLCJweXRob24iXX0=-->

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

django.template.Template.render() has incorrectly typed argument
7 participants