From c5e794a0f21d5ebd8db764ae34d8026cf5caf365 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 5 Sep 2018 10:41:24 +0200 Subject: Quick actions: generic urls, views and forms --- ishtar_common/widgets.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index fc8926364..b5e1f5891 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -1033,6 +1033,7 @@ class DataTable(Select2Media, forms.RadioSelect): # dct['source_full'] = unicode(self.source_full) dct['extra_sources'] = [] + dct['quick_actions'] = [] if self.associated_model: model_name = "{}.{}".format( self.associated_model.__module__, @@ -1043,6 +1044,10 @@ class DataTable(Select2Media, forms.RadioSelect): dct['extra_sources'].append(( imp.slug, imp.name, reverse('get-by-importer', args=[imp.slug]))) + if hasattr(self.associated_model, "QUICK_ACTIONS"): + dct['quick_actions'] = \ + self.associated_model.get_quick_actions(user=self.user) + self.multiple_select = True source = unicode(self.source) dct.update({'name': name, 'col_names': col_names, -- cgit v1.2.3