diff options
author | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-22 13:51:30 +0200 |
---|---|---|
committer | Étienne Loks <etienne.loks@iggdrasil.net> | 2016-10-22 13:51:30 +0200 |
commit | cd1b777d6e95d1895780b414870ec27358ac0dd3 (patch) | |
tree | 904c5114a778b5d2bdeb688f842ef084caed4f97 /ishtar_common/widgets.py | |
parent | 950cfb19a1c809e9d5e777c2750b3dd3f39bbf9f (diff) | |
parent | 480fa4f7e9a0ca6fed3b1f444807734d854de2b0 (diff) | |
download | Ishtar-cd1b777d6e95d1895780b414870ec27358ac0dd3.tar.bz2 Ishtar-cd1b777d6e95d1895780b414870ec27358ac0dd3.zip |
Merge branch 'v0.9' into wheezy
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r-- | ishtar_common/widgets.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 48d1377fa..9e656311b 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -602,6 +602,19 @@ class JQueryJqGrid(forms.RadioSelect): dct['source'] = unicode(self.source) if unicode(self.source_full) and unicode(self.source_full) != 'None': dct['source_full'] = unicode(self.source_full) + + dct['extra_sources'] = [] + if self.associated_model: + model_name = "{}.{}".format( + self.associated_model.__module__, + self.associated_model.__name__) + for imp in models.ImporterType.objects.filter( + slug__isnull=False, associated_models=model_name, + is_template=True).all(): + dct['extra_sources'].append(( + imp.slug, imp.name, + reverse('get-by-importer', args=[imp.slug]))) + dct.update({'name': name, 'col_names': col_names, 'extra_cols': extra_cols, |