summaryrefslogtreecommitdiff
path: root/ishtar_common/widgets.py
diff options
context:
space:
mode:
authorÉtienne Loks <etienne.loks@iggdrasil.net>2018-09-05 10:41:24 +0200
committerÉtienne Loks <etienne.loks@iggdrasil.net>2018-10-24 12:06:08 +0200
commit40c94fba1a9e3e119af8738f75f1e8082feb0c8b (patch)
tree63a7d4c8f7cb34c6f4c0c9089bfafce00a46dfd8 /ishtar_common/widgets.py
parente5568da593a5bc13ab2065ec22a2d6b035be756b (diff)
downloadIshtar-40c94fba1a9e3e119af8738f75f1e8082feb0c8b.tar.bz2
Ishtar-40c94fba1a9e3e119af8738f75f1e8082feb0c8b.zip
Quick actions: generic urls, views and forms
Diffstat (limited to 'ishtar_common/widgets.py')
-rw-r--r--ishtar_common/widgets.py5
1 files changed, 5 insertions, 0 deletions
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,