diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-24 15:05:28 +0200 |
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2025-10-24 18:20:47 +0200 |
| commit | ced53a87545352e43c0c2f71103f706d8868aaf7 (patch) | |
| tree | e163edb8604fa77cf38a589ca6433e249b74e60e /ishtar_common/models_common.py | |
| parent | 83a91075308b7864a410bb9285d34ec58e6535cb (diff) | |
| download | Ishtar-ced53a87545352e43c0c2f71103f706d8868aaf7.tar.bz2 Ishtar-ced53a87545352e43c0c2f71103f706d8868aaf7.zip | |
🐛 ✨ person, organization tables: fix and optimize town name and person type list (refs #6441)
Diffstat (limited to 'ishtar_common/models_common.py')
| -rw-r--r-- | ishtar_common/models_common.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ishtar_common/models_common.py b/ishtar_common/models_common.py index ce31cb974..75aa6c986 100644 --- a/ishtar_common/models_common.py +++ b/ishtar_common/models_common.py @@ -4201,6 +4201,9 @@ class Address(BaseHistorizedItem): alt_address_is_prefered = models.BooleanField( _("Alternative address is prefered"), default=False ) + cached_town = models.TextField( + _("Cached town"), blank=True, default="" + ) history = HistoricalRecords(inherit=True) SUB_ADDRESSES = [] ALT_NAMES = { @@ -4394,6 +4397,11 @@ class Address(BaseHistorizedItem): def address_lbl_list(self): return self.address_lbl(list=True) + def _generate_cached_town(self): + if self.precise_town: + return self.precise_town.name + return self.town or "" + class Merge(models.Model): merge_key = models.TextField(_("Merge key"), blank=True, null=True) |
