diff --git a/django/db/models/options.py b/django/db/models/options.py index 6f08feec25..f842faf0da 100644 --- a/django/db/models/options.py +++ b/django/db/models/options.py @@ -1,6 +1,5 @@ import bisect import copy -import inspect from collections import defaultdict from django.apps import apps @@ -969,11 +968,13 @@ class Options: @cached_property def _property_names(self): """Return a set of the names of the properties defined on the model.""" - names = [] - for name in dir(self.model): - attr = inspect.getattr_static(self.model, name) - if isinstance(attr, property): - names.append(name) + names = set() + for klass in self.model.__mro__: + names |= { + name + for name, value in klass.__dict__.items() + if isinstance(value, property) + } return frozenset(names) @cached_property