diff options
| author | Adam Johnson <me@adamj.eu> | 2024-02-26 05:20:16 +0000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-02-26 06:20:16 +0100 |
| commit | e65deb7d14a57ba788b978d50bd8198e659faa91 (patch) | |
| tree | b80db834de146caf51703397320451f1a476d9e2 | |
| parent | 73d5eb808435bcf27ebc935847196ac9e97b6ddc (diff) | |
Fixed #35246 -- Made Field.unique a cached property.
Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
| -rw-r--r-- | django/db/models/fields/__init__.py | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/django/db/models/fields/__init__.py b/django/db/models/fields/__init__.py index cc5025af84..796c4d23c4 100644 --- a/django/db/models/fields/__init__.py +++ b/django/db/models/fields/__init__.py @@ -916,7 +916,7 @@ class Field(RegisterLookupMixin): return [self.from_db_value] return [] - @property + @cached_property def unique(self): return self._unique or self.primary_key |
