Hi Max,
I've tried to test NewDataGrid on my controllers (by adding
list_widget = NewDataGrid() to my subclasses) but I can't seem to
make it work. I get the following exception:
Traceback (most recent call last):
File "./start-n50cpanel.py", line 25, in ?
from n50cpanel.controllers import Root
File "/Users/alberto/src/n50cpanel/n50cpanel/controllers.py", line
61, in ?
class PanelDataController(DataController):
File "/Users/alberto/src/n50cpanel/n50cpanel/controllers.py", line
65, in PanelDataController
list_widget = NewDataGrid()
File "/Users/alberto/src/turbogears/turbogears/widgets/
newbase.py", line 42, in widgetinit
func(self, *args, **kw)
File "/Users/alberto/src/turbogears/turbogears/newfastdata/
datawidgets.py", line 152, in __init__
raise ValueError, "no fields specified and model is null"
ValueError: no fields specified and model is null
Is it backwards compatible with the current DataController code?
It seems to me by reading the code that the NewDataGrid is less
flexible than DataGrid as it forces you to specify the fields (or
model) at construction time, while DataGrid let's you pass a new
SelectResults (from different sqlobject classes) on each render (in a
thread-safe way). It also preserves the original interface (and tries
to confirm deletion ;)
Regards, Alberto
On Feb 4, 2006, at 7:41 AM, Max Ischenko wrote:
Oh, I noticed Kevin patched it as well and put in newfastdata.
Still I think my version is more "correct". ;-)
Kevin, would you mind to review it, I added it as NewDataGrid to
newfastdata/datawidgets.py.