Ticket #2478 (closed enhancement: fixed)
[PATCH] TG Widgets: Improve DataGrid widget, allow to use list/dict as value holders
| Reported by: | xaka | Owned by: | Chris Arndt |
|---|---|---|---|
| Priority: | normal | Milestone: | 1.1.2 |
| Component: | TG Widgets | Version: | 1.1 HEAD |
| Severity: | normal | Keywords: | |
| Cc: |
Description
there is no way to redefine attrwrapper in child classes
class MyDataGrid(DataGrid):
class attrwrapper(object): # i redefined it, but DataGrid.attrwrapper still in use
pass
there is no way to use list/tuple or dict objects as value holders
grid = DataGrid(fields=[
('Field 1', 'key1'),
('Field 2', 'key2'),
])
grid.display([{
'key1' : 'val1',
'key2' : 'val2'
}])
# ===
grid = DataGrid(fields=[
('Field 1', 0),
('Field 2', 1),
])
grid.display([
('val1', 'val2'),
('val3', 'val4')
])
Patch and additional tests attached.
---------------------------------------------------------------------- Ran 448 tests in 71.940s OK
Attachments
Change History
Note: See
TracTickets for help on using
tickets.
