From ef6caa68eacd4ceb5aa14a90fdd0a1efafa619f5 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Fri, 17 Aug 2018 12:51:42 +0200 Subject: Wizard - can specify explicitly through name --- ishtar_common/wizards.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'ishtar_common/wizards.py') diff --git a/ishtar_common/wizards.py b/ishtar_common/wizards.py index b1e0c7fd2..6209a16c3 100644 --- a/ishtar_common/wizards.py +++ b/ishtar_common/wizards.py @@ -1320,8 +1320,11 @@ class Wizard(IshtarWizard): # manage through through = False if hasattr(related, 'through') and related.through: - related_set_name = str( - related.through.__name__ + '_set').lower() + if hasattr(c_form, "form_through_name"): + related_set_name = c_form.form_through_name + else: + related_set_name = str( + related.through.__name__ + '_set').lower() if hasattr(obj, related_set_name): through = True related = getattr(obj, related_set_name) -- cgit v1.2.3