diff --git a/django-stubs/core/exceptions.pyi b/django-stubs/core/exceptions.pyi index 1a335aa5e..ceaada382 100644 --- a/django-stubs/core/exceptions.pyi +++ b/django-stubs/core/exceptions.pyi @@ -9,6 +9,7 @@ class AppRegistryNotReady(Exception): ... class ObjectDoesNotExist(Exception): silent_variable_failure: bool +class ObjectNotUpdated(Exception): ... class MultipleObjectsReturned(Exception): ... class SuspiciousOperation(Exception): ... class SuspiciousMultipartForm(SuspiciousOperation): ... diff --git a/django-stubs/db/models/base.pyi b/django-stubs/db/models/base.pyi index 3cdce76b8..54840daa4 100644 --- a/django-stubs/db/models/base.pyi +++ b/django-stubs/db/models/base.pyi @@ -3,7 +3,7 @@ from typing import Any, ClassVar, Final, TypeVar, overload from django.core.checks.messages import CheckMessage from django.core.exceptions import MultipleObjectsReturned as BaseMultipleObjectsReturned -from django.core.exceptions import ObjectDoesNotExist, ValidationError +from django.core.exceptions import ObjectDoesNotExist, ObjectNotUpdated, ValidationError from django.db.models import BaseConstraint, Field, QuerySet from django.db.models.manager import Manager from django.db.models.options import Options @@ -40,6 +40,7 @@ class Model(metaclass=ModelBase): # and re-add them to correct concrete subclasses of 'Model' DoesNotExist: Final[type[ObjectDoesNotExist]] MultipleObjectsReturned: Final[type[BaseMultipleObjectsReturned]] + NotUpdated: Final[type[ObjectNotUpdated]] # This 'objects' attribute will be deleted, via the plugin, in favor of managing it # to only exist on subclasses it exists on during runtime. objects: ClassVar[Manager[Self]] diff --git a/scripts/stubtest/allowlist_todo_django60.txt b/scripts/stubtest/allowlist_todo_django60.txt index adcab54d4..bbd6cc4e1 100644 --- a/scripts/stubtest/allowlist_todo_django60.txt +++ b/scripts/stubtest/allowlist_todo_django60.txt @@ -6,7 +6,6 @@ django.conf.global_settings.TASKS django.conf.global_settings.URLIZE_ASSUME_HTTPS django.contrib.admin.AdminSite.password_change_form django.contrib.admin.ModelAdmin.log_deletion -django.contrib.admin.models.LogEntry.NotUpdated django.contrib.admin.models.LogEntryManager.log_action django.contrib.admin.options.BaseModelAdmin.lookup_allowed django.contrib.admin.options.ModelAdmin.log_deletion @@ -22,9 +21,6 @@ django.contrib.auth.checks.check_user_model django.contrib.auth.forms.SetPasswordMixin.__class_getitem__ django.contrib.auth.management.RenamePermission django.contrib.auth.management.rename_permissions -django.contrib.auth.models.Group.NotUpdated -django.contrib.auth.models.Permission.NotUpdated -django.contrib.auth.models.User.NotUpdated django.contrib.auth.templatetags django.contrib.auth.templatetags.auth django.contrib.contenttypes.checks.check_generic_foreign_keys @@ -32,16 +28,8 @@ django.contrib.contenttypes.checks.check_model_name_lengths django.contrib.contenttypes.fields.GenericForeignKey.ct_field_attname django.contrib.contenttypes.fields.GenericForeignKey.get_prefetch_queryset django.contrib.contenttypes.management.get_contenttypes_and_models -django.contrib.contenttypes.models.ContentType.NotUpdated -django.contrib.flatpages.models.FlatPage.NotUpdated django.contrib.gis.admin.AdminSite.password_change_form django.contrib.gis.admin.ModelAdmin.log_deletion -django.contrib.gis.db.backends.oracle.models.OracleGeometryColumns.NotUpdated -django.contrib.gis.db.backends.oracle.models.OracleSpatialRefSys.NotUpdated -django.contrib.gis.db.backends.postgis.models.PostGISGeometryColumns.NotUpdated -django.contrib.gis.db.backends.postgis.models.PostGISSpatialRefSys.NotUpdated -django.contrib.gis.db.backends.spatialite.models.SpatialiteGeometryColumns.NotUpdated -django.contrib.gis.db.backends.spatialite.models.SpatialiteSpatialRefSys.NotUpdated django.contrib.gis.db.models.Aggregate.allow_order_by django.contrib.gis.db.models.AnyValue django.contrib.gis.db.models.BaseConstraint.__init__ @@ -100,16 +88,12 @@ django.contrib.postgres.search.psql_escape django.contrib.postgres.search.quote_lexeme django.contrib.postgres.search.spec_chars_re django.contrib.postgres.utils.CheckPostgresInstalledMixin -django.contrib.redirects.models.Redirect.NotUpdated -django.contrib.sessions.models.Session.NotUpdated -django.contrib.sites.models.Site.NotUpdated django.contrib.staticfiles.checks.check_finders django.contrib.staticfiles.checks.check_storages django.core.checks.model_checks.check_all_models django.core.checks.model_checks.check_lazy_references django.core.checks.security.base.E026 django.core.checks.security.base.check_csp_settings -django.core.exceptions.ObjectNotUpdated django.core.mail.EmailMessage.__init__ django.core.mail.EmailMessage.message django.core.mail.EmailMultiAlternatives.__init__ @@ -178,7 +162,6 @@ django.db.migrations.executor.MigrationExecutor.record_migration django.db.migrations.loader.MigrationLoader.all_replaced_applied django.db.migrations.loader.MigrationLoader.replace_migration django.db.migrations.operations.base.Operation.__replace__ -django.db.migrations.recorder.MigrationRecorder.Migration.NotUpdated django.db.migrations.serializer.DeconstructableSerializer django.db.migrations.serializer.DeconstructibleSerializer django.db.migrations.serializer.ZoneInfoSerializer