Warning: Can't synchronize with repository "(default)" (Unsupported version control system "svn": No module named svn). Look in the Trac log for more information.

Ticket #2478 (closed enhancement: fixed)

Opened 7 years ago

Last modified 6 years ago

[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

turbogears.patch Download (4.2 KB) - added by xaka 7 years ago.

Change History

Changed 7 years ago by xaka

comment:1 Changed 7 years ago by chrisz

  • Milestone changed from __unclassified__ to 1.1.2

comment:2 Changed 6 years ago by chrisz

  • Status changed from new to closed
  • Resolution set to fixed

Thanks, applied in r7169. Sorry for the delay.

Note: See TracTickets for help on using tickets.