From 0ae3b866b122b7db425436911f7b19122c229ab0 Mon Sep 17 00:00:00 2001 From: Étienne Loks Date: Wed, 26 Dec 2018 11:22:03 +0100 Subject: Table gallery: optionnaly display the gallery on tables --- ishtar_common/widgets.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'ishtar_common/widgets.py') diff --git a/ishtar_common/widgets.py b/ishtar_common/widgets.py index 5853c9675..aee4eb95d 100644 --- a/ishtar_common/widgets.py +++ b/ishtar_common/widgets.py @@ -953,7 +953,7 @@ class DataTable(Select2Media, forms.RadioSelect): table_cols='TABLE_COLS', multiple=False, multiple_cols=[2], new=False, new_message="", source_full=None, multiple_select=False, sortname="__default__", - col_prefix=''): + col_prefix='', gallery=False): """ DataTable widget init. @@ -970,6 +970,7 @@ class DataTable(Select2Media, forms.RadioSelect): :param multiple_select: select multiple is available :param sortname: column name (model attribute) to use to sort :param col_prefix: prefix to remove to col_names + :param gallery: display the gallery if True """ super(DataTable, self).__init__(attrs=attrs) self.source = source @@ -987,6 +988,7 @@ class DataTable(Select2Media, forms.RadioSelect): self.sortname = sortname self.col_prefix = col_prefix self.user = None + self.gallery = gallery if self.col_prefix and not self.col_prefix.endswith('__'): self.col_prefix += "__" @@ -1105,6 +1107,7 @@ class DataTable(Select2Media, forms.RadioSelect): 'loading': unicode(_("Loading...")), 'remove': unicode(_(u"Remove")), 'sname': name.replace('-', ''), + 'gallery': self.gallery, 'multiple': self.multiple, 'multiple_select': self.multiple_select, 'multi_cols': ",".join((u'"%d"' % col -- cgit v1.2.3