From f6c6695b19f6d75dc5fa6da0d1389f90f24835bc Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 16 Feb 2024 15:58:53 +0100 Subject: ✨ Biographical note sheet MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ishtar_common/models.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index 187df4126..a5e666b13 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -3231,10 +3231,11 @@ def text_format(text, text_format): return mark_safe(markdown(text)) elif text_format == "HT": return mark_safe(bleach.clean(text)) - return text_format + return text class BiographicalNote(BaseHistorizedItem, ValueGetter, MainItem): + SLUG = "biographicalnote" denomination = models.TextField(_("Denomination")) last_name = models.TextField(_("Last name"), blank=True, default="") first_name = models.TextField(_("First name"), blank=True, default="") @@ -3244,10 +3245,14 @@ class BiographicalNote(BaseHistorizedItem, ValueGetter, MainItem): biography_format = models.CharField( _("Biography format"), blank=True, default="NO", max_length=2, choices=TEXT_FORMAT ) - person = models.ForeignKey(Person, blank=True, null=True, on_delete=models.SET_NULL, verbose_name=_("Person")) + person = models.ForeignKey( + Person, blank=True, null=True, on_delete=models.SET_NULL, verbose_name=_("Person"), + related_name="biographical_notes" + ) organization = models.ForeignKey( Organization, blank=True, null=True, on_delete=models.SET_NULL, verbose_name=_("Organization"), + related_name="biographical_notes" ) class Meta: -- cgit v1.2.3