apis_core.generic.tables#
Module Contents#
Classes#
A custom template column - the tables.TemplateColumn class does not allow to set attributes via class variables. Therefor we use this CustomTemplateColumn to set some arguments based on class attributes and override the attributes in child classes. |
|
A custom template column with some additional attributes for actions. |
|
A column showing a model description |
|
A generic table that contains an edit button column, a delete button column and a description column |
|
Useful for displaying long fields. A preview is shown initially with a “Show more” link which is replaced with a “Show less” link when expanded. |
API#
- class apis_core.generic.tables.CustomTemplateColumn(*args, **kwargs)[source]#
Bases:
django_tables2.TemplateColumnA custom template column - the tables.TemplateColumn class does not allow to set attributes via class variables. Therefor we use this CustomTemplateColumn to set some arguments based on class attributes and override the attributes in child classes.
Initialization
- template_name = None#
- orderable = None#
- exclude_from_export = False#
- verbose_name = None#
- class apis_core.generic.tables.ActionColumn(*args, **kwargs)[source]#
Bases:
apis_core.generic.tables.CustomTemplateColumnA custom template column with some additional attributes for actions.
Initialization
- orderable = False#
- exclude_from_export = True#
- attrs = None#
- class apis_core.generic.tables.ActionsColumn(*args, **kwargs)[source]#
Bases:
apis_core.generic.tables.CustomTemplateColumn- orderable = False#
- exclude_from_export = True#
- template_name = 'columns/actions.html'#
- attrs = None#
- class apis_core.generic.tables.DescriptionColumn(*args, **kwargs)[source]#
Bases:
apis_core.generic.tables.CustomTemplateColumnA column showing a model description
Initialization
- template_name = 'columns/description.html'#
- orderable = False#
- class apis_core.generic.tables.GenericTable(data=None, order_by=None, orderable=None, empty_text=None, exclude=None, attrs=None, row_attrs=None, pinned_row_attrs=None, sequence=None, prefix=None, order_by_field=None, page_field=None, per_page_field=None, template_name=None, default=None, request=None, show_header=None, show_footer=True, extra_columns=None)[source]#
Bases:
django_tables2.TableA generic table that contains an edit button column, a delete button column and a description column
Initialization
- desc = 'DescriptionColumn(...)'#
- actions = 'ActionsColumn(...)'#
- class apis_core.generic.tables.MoreLessColumn(preview, fulltext, *args, **kwargs)[source]#
Bases:
django_tables2.TemplateColumnUseful for displaying long fields. A preview is shown initially with a “Show more” link which is replaced with a “Show less” link when expanded.
Initialization
- template_name = 'columns/more-less.html'#