table
A Table and a ColumnGroup class to define table views that
are more complex.
-
class camelot.admin.table.ColumnGroup(verbose_name, columns, icon=None)[source]
A group of columns to be displayed in a table view. By building a Table
with multiple column groups, lots of data can be displayed in a limited
space.
param verbose_name: |
| the text to be displayed in the tab widget of the
column group |
param columns: | a list of fields to display within this column group |
param icon: | a camelot.view.art.Icon object |
-
get_fields()[source]
Returns: | an ordered list of field names displayed in the column group |
-
class camelot.admin.table.Table(columns)[source]
Represents the columns that should be displayed in a table view.
param columns: | a list of strings with the fields to be displayed, or a
list of ColumnGroup objects |
-
get_fields()[source]
Returns: | a ordered list of field names displayed in the table |
-
render(item_view, parent=None)[source]
Create a tab widget that allows the user to switch between column
groups.
param item_view: |
| a QtGui.QAbstractItemView object. |
param parent: | a QtGui.QWidget object |
-
camelot.admin.table.structure_to_table(structure)[source]
Convert a python data structure to a table, using the following rules :
- if structure is an instance of Table, return structure
- if structure is a list, create a Table from this list