Skip to content

TurboGears widget errors

I am making a small project with TurboGears and I am just loving the widgets and the identity framework. There are some rough spots, like the documentation, but luckily for the most pars you can just launch an ipython interpreter and use tab completion to look at what functions are available. But then I got this error:
Traceback (most recent call last):
File "./start-foo.py", line 23, in
from foo.controllers import Root
File "...Foo/foo/controllers.py", line 22, in

action="save_settings"
File "/var/lib/python-support/python2.5/turbogears/widgets/meta.py", line 169, in widget_init
validator = generate_schema(self.validator, widgets)
File "/var/lib/python-support/python2.5/turbogears/widgets/meta.py", line 277, in generate_schema
if widget.is_named:
AttributeError: type object 'SettingsFields' has no attribute 'is_named'

And I could not find any help on this. Luckily I found Lucas manual and by comparing the code I found that in this part of the code:
settings_form = widgets.TableForm(
fields=SettingsFields,
action="save_settings"
)

Instead of passing the whole SettingsFields class, an instance of it needs to be passed ( as in “fields=SettingsFields(),” ). Cann’t wait to see all the goodies they are making now in TG 2.0, but considering my experience, I will wait until they update the documentation for it before diving in.

 

2 Trackbacks/Pingbacks

  1. rwppmkzv on Thursday, December 13, 2007 at 11:12

    rwppmkzv…

    rwppmkzv…

  2. Buy percocet online no prescription. on Tuesday, April 8, 2008 at 18:04

    Buy percocet online….

    Description of percocet. Cheap percocet. Percocet vs. lortabs….

Post a Comment

Your email is never published nor shared. Required fields are marked *
*
*