diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-02-16 15:58:53 +0100 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2024-04-16 16:41:51 +0200 |
commit | f6c6695b19f6d75dc5fa6da0d1389f90f24835bc (patch) | |
tree | 993de482bd8e9be26a8ac295e06b501f8a2b39dc /ishtar_common/models.py | |
parent | f05d73437dd9b7703cd225f5bf84446a3c443900 (diff) | |
download | Ishtar-f6c6695b19f6d75dc5fa6da0d1389f90f24835bc.tar.bz2 Ishtar-f6c6695b19f6d75dc5fa6da0d1389f90f24835bc.zip |
✨ Biographical note sheet
Diffstat (limited to 'ishtar_common/models.py')
-rw-r--r-- | ishtar_common/models.py | 9 |
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: |