summaryrefslogtreecommitdiff
path: root/ishtar_common/models.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2024-02-16 15:58:53 +0100
committerÉtienne Loks <etienne.loks@iggdrasil.net>2024-02-18 15:06:36 +0100
commit4e7482c127cc93647975438a45dca5ed796fdaeb (patch)
tree1450b11f202adf561e5b4b45dcb9a3e284d004cb /ishtar_common/models.py
parentdf65704a56b0a36902b48ba63e0141f2583abd3e (diff)
downloadIshtar-4e7482c127cc93647975438a45dca5ed796fdaeb.tar.bz2
Ishtar-4e7482c127cc93647975438a45dca5ed796fdaeb.zip
✨ Biographical note sheet
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r--ishtar_common/models.py9
1 files changed, 7 insertions, 2 deletions
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: