summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/ishtar_common/models.py b/ishtar_common/models.py
index 5858fdb78..d51784b72 100644
--- a/ishtar_common/models.py
+++ b/ishtar_common/models.py
@@ -1385,7 +1385,7 @@ class IshtarSiteProfile(models.Model, Cached):
)
museum_complete_identifier = models.TextField(
_("Find - Complete museum ID"),
- default="{{museum_id_prefix}}.{{museum_id}}.{{museum_id_suffix}}",
+ default="{% if museum_id_prefix %}{{museum_id_prefix}}.{% endif %}{{museum_id}}{% if museum_id_suffix %}.{{museum_id_suffix}}{% endif %}",
help_text=_(
"Formula to manage cached label. If not set a default formula is used."
),
@@ -3244,12 +3244,24 @@ class BiographicalNote(models.Model):
biography_format = models.CharField(
_("Biography format"), blank=True, default="NO", max_length=2, choices=TEXT_FORMAT
)
- person = models.ForeignKey(Person, verbose_name=_("Person"), blank=True, null=True, on_delete=models.SET_NULL)
+ person = models.ForeignKey(Person, blank=True, null=True, on_delete=models.SET_NULL, verbose_name=_("Person"))
+ organization = models.ForeignKey(
+ Organization, blank=True, null=True, on_delete=models.SET_NULL,
+ verbose_name=_("Organization"),
+ )
+
+ class Meta:
+ verbose_name = _("Biographical note")
+ verbose_name_plural = _("Biographical notes")
+ ADMIN_SECTION = _("Directory")
@property
def formatted_biography(self):
return text_format(self.biography, self.biography_format)
+ def __str__(self):
+ return self.denomination
+
GDPR_ACTIVITY = (
("DC", _("Directory consultation")),