diff --git a/django/contrib/admin/__init__.py b/django/contrib/admin/__init__.py index bc2fa3eb51e4..9fd1825921d9 100644 --- a/django/contrib/admin/__init__.py +++ b/django/contrib/admin/__init__.py @@ -14,6 +14,7 @@ from django.contrib.admin.options import ( HORIZONTAL, VERTICAL, + Action, ActionLocation, ModelAdmin, ShowFacets, @@ -25,6 +26,7 @@ __all__ = [ "action", + "Action", "ActionLocation", "display", "register", diff --git a/django/db/models/base.py b/django/db/models/base.py index 7ac02f8a50a0..c88a10118a6e 100644 --- a/django/db/models/base.py +++ b/django/db/models/base.py @@ -710,7 +710,7 @@ def _set_pk_val(self, value): def _is_pk_set(self, meta=None): pk_val = self._get_pk_val(meta) - def _is_set(value): + def _is_unset(value): return ( value is None # Empty value when db_default is used. @@ -718,8 +718,8 @@ def _is_set(value): ) return not ( - _is_set(pk_val) - or (isinstance(pk_val, tuple) and any(_is_set(f) for f in pk_val)) + _is_unset(pk_val) + or (isinstance(pk_val, tuple) and any(_is_unset(f) for f in pk_val)) ) def get_deferred_fields(self):