diff options
| author | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-17 12:51:42 +0200 | 
|---|---|---|
| committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2018-08-17 12:51:42 +0200 | 
| commit | 6e428194efb5dc8d3e2828d06926d10fcfcbeba9 (patch) | |
| tree | 4a00e53e77deff744fdd21ea098b49a1a3741a36 | |
| parent | 5a46204fea3bffce673eb0b97c2cca50b8a664fd (diff) | |
| download | Ishtar-6e428194efb5dc8d3e2828d06926d10fcfcbeba9.tar.bz2 Ishtar-6e428194efb5dc8d3e2828d06926d10fcfcbeba9.zip | |
Wizard - can specify explicitly through name
| -rw-r--r-- | archaeological_warehouse/forms.py | 1 | ||||
| -rw-r--r-- | ishtar_common/wizards.py | 7 | 
2 files changed, 6 insertions, 2 deletions
| diff --git a/archaeological_warehouse/forms.py b/archaeological_warehouse/forms.py index 57992c7e2..350e48814 100644 --- a/archaeological_warehouse/forms.py +++ b/archaeological_warehouse/forms.py @@ -76,6 +76,7 @@ SelectedDivisionFormset = formset_factory(  SelectedDivisionFormset.form_label = _(u"Divisions")  SelectedDivisionFormset.form_admin_name = _(u"Warehouse - 020 - Divisions")  SelectedDivisionFormset.form_slug = "warehouse-020-divisions" +SelectedDivisionFormset.form_through_name = "divisions"  class WarehouseSelect(TableSelect): 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) | 
