From 975b971ae6efacbd5614be7f057f32d7c302966b Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 27 Nov 2020 11:26:55 +0100 Subject: Documents: dynamic filter of support and medium by document type - collapse related fields on edition --- ishtar_common/models.py | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'ishtar_common/models.py') diff --git a/ishtar_common/models.py b/ishtar_common/models.py index e251fee89..ffe302454 100644 --- a/ishtar_common/models.py +++ b/ishtar_common/models.py @@ -2636,6 +2636,11 @@ post_delete.connect(post_save_cache, sender=SourceType) class SupportType(GeneralType): + document_types = models.ManyToManyField( + "SourceType", blank=True, related_name='supports', + help_text=_("Only available for theses document types") + ) + class Meta: verbose_name = _("Support type") verbose_name_plural = _("Support types") @@ -2651,6 +2656,10 @@ class Format(GeneralType): help_text=_("Template to insert an iframe for this format. Use django " "template with a {{document}} variable matching the " "current document.")) + document_types = models.ManyToManyField( + "SourceType", blank=True, related_name='formats', + help_text=_("Only available for theses document types") + ) class Meta: verbose_name = _("Format type") -- cgit v1.2.3