Fixed #35246 -- Made Field.unique a cached property.

Co-authored-by: Natalia <124304+nessita@users.noreply.github.com>
This commit is contained in:
Adam Johnson 2024-02-26 05:20:16 +00:00 committed by GitHub
parent 73d5eb8084
commit e65deb7d14
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 1 additions and 1 deletions

View File

@ -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