diff --git a/mibios/glamr/tables.py b/mibios/glamr/tables.py index fc5131c..d514fc1 100644 --- a/mibios/glamr/tables.py +++ b/mibios/glamr/tables.py @@ -82,10 +82,10 @@ def is_for_export(self): Use this method to branch into optimized code for paginated HTML vs. whole dataset export. """ - try: - return self.view.export_check() is not None - except Exception: - # not a view with ExportMixin + if hasattr(self.view, 'check_export_request'): + # View is ExportMixin + return self.view.check_export_request() + else: return False def get_extra_excludes(self): diff --git a/mibios/glamr/views.py b/mibios/glamr/views.py index 01c4efa..238ad14 100644 --- a/mibios/glamr/views.py +++ b/mibios/glamr/views.py @@ -186,10 +186,6 @@ def get_format(self, fmt_name='tab'): def get_export_queryset(self, export_option): """ Get the queryset corresponding to given export option. - - The returned queryset needs to have all filters applied so it's - accurate when exist() is run on it, but is not expected to have - table-specific columns or annotations set yet. """ if export_option is self.EXPORT_TABLE: return self.get_queryset() @@ -240,7 +236,7 @@ def get_export_table(self): except (AttributeError, KeyError): # other views or model not listed tab_cls = table_factory(qs.model, table=tables.Table) - return tab_cls(data=qs) + return tab_cls(data=qs, view=self) def get_values(self): """