From 045b5b604f824be59c122450ce8c5af6fc9ceae4 Mon Sep 17 00:00:00 2001 From: Slava Nabatchikov Date: Thu, 16 Apr 2026 22:43:13 +0300 Subject: [PATCH] changed return type for Model.update() --- {{ cookiecutter.name }}/src/app/models.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/{{ cookiecutter.name }}/src/app/models.py b/{{ cookiecutter.name }}/src/app/models.py index 6b8653ff..d93fcb1d 100644 --- a/{{ cookiecutter.name }}/src/app/models.py +++ b/{{ cookiecutter.name }}/src/app/models.py @@ -1,5 +1,5 @@ from collections.abc import Iterable -from typing import Any +from typing import Any, Self from django.contrib.contenttypes.models import ContentType from django.db import models @@ -30,7 +30,7 @@ def __str__(self) -> str: def get_contenttype(cls) -> ContentType: return ContentType.objects.get_for_model(cls) - def update(self, **kwargs: "Any") -> "models.Model": + def update(self, **kwargs: Any) -> Self: for key, value in kwargs.items(): setattr(self, key, value)