diff options
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py index af1c70dce..2745bf4b6 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -1069,6 +1069,29 @@ class Address(BaseHistorizedItem): class Meta: abstract = True + def address_lbl(self): + lbl = '' + if self.address: + lbl += self.address + if self.address_complement: + if lbl: + lbl += "\n" + lbl += self.address_complement + if self.postal_code or self.town: + if lbl: + lbl += "\n" + lbl += "{}{}{}".format( + self.postal_code or '', + " " if self.postal_code and self.town else '', + self.town or '') + if self.phone: + lbl += "{}{}".format(_("Tel:"), self.phone) + if self.mobile_phone: + lbl += "{}{}".format(_("Mobile: "), self.mobile_phone) + if self.email: + lbl += "{}{}".format(_("Email: "), self.email) + return lbl + class Merge(models.Model): merge_key = models.CharField(_("Merge key"), max_length=300, |