On Nov 5, 2006, at 8:42 AM, Diez B. Roggisch wrote:
> So it should work for your compound widget above, if you pass the
> value
> like this:
>
> time_form.display({'w_task' : optionlist})
I could not get this to work. It would seem to me that there needs
to be someway to tell the w_task widget that optionlist is an options
list.
Everything else is working except passing the new options to the
widgets.SingleSelectField by way of the form.
controller.py
@expose(template="timesheetweb.templates.timeEntry")
def timeEntry(self, tg_errors=None):
cherrypy.session['cur_project'] = cherrypy.session.get
('cur_project', 1)
task_options=[(p.id, p.taskName) for p in task.select
(task.q.projectID==cherrypy.session['cur_project'],
orderBy=task.q.taskName)]
if tg_errors:
flash("Data Entry Error!")
return dict(project_form=project_form, time_form=time_form,
optionlist=task_options)
timeEntry.kid
<body>
<p py:content="project_form.display()">Project Form</p>
<p py:content="time_form.display({'w_task': optionlist})">Time Form</p>
</body>
2006-11-05 11:26:48,182 cherrypy.msg INFO HTTP: Page handler: <bound
method Root.timeEntry of <timesheetweb.controllers.Root object at
0x1778710>>
Traceback (most recent call last):
File "/Maui-Dev/TurboGears/turbogears/thirdparty/cherrypy/cherrypy/
_cphttptools.py", line 106, in _run
self.main()
File "/Maui-Dev/TurboGears/turbogears/thirdparty/cherrypy/cherrypy/
_cphttptools.py", line 255, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in timeEntry
File "/Maui-Dev/TurboGears/turbogears/turbogears/controllers.py",
line 275, in expose
output = database.run_with_transaction(
File "<string>", line 5, in run_with_transaction
File "/Maui-Dev/TurboGears/turbogears/turbogears/database.py",
line 247, in so_rwt
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/Maui-Dev/TurboGears/turbogears/turbogears/controllers.py",
line 292, in <lambda>
mapping, fragment, args, kw)))
File "/Maui-Dev/TurboGears/turbogears/turbogears/controllers.py",
line 329, in _execute_func
return _process_output(output, template, format, content_type,
mapping, fragment)
File "/Maui-Dev/TurboGears/turbogears/turbogears/controllers.py",
line 72, in _process_output
mapping=mapping, content_type=content_type,fragment=fragment)
File "/Maui-Dev/TurboGears/turbogears/turbogears/view/base.py",
line 126, in render
return turbogears.util.adapt_call(engine.render, **dict
(info=info, format=format, fragment=fragment, template=template,
mapping=mapping))
File "/Maui-Dev/TurboGears/turbogears/turbogears/util.py", line
163, in adapt_call
return func(*args, **kw)
File "/sw/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/
turbokid/kidsupport.py", line 158, in render
tclass = self.load_template(template)
File "/sw/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/
turbokid/kidsupport.py", line 128, in load_template
mod = _compile_template(package, basename, tfile, classname)
File "/sw/lib/python2.4/site-packages/TurboKid-0.9.9-py2.4.egg/
turbokid/kidsupport.py", line 15, in _compile_template
mod = kid.load_template(tfile, name=classname)
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
__init__.py", line 123, in load_template
code = template.compile(dump_code=cache,
dump_source=os.environ.get('KID_OUTPUT_PY'))
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
compiler.py", line 87, in compile
code = self.code
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
compiler.py", line 101, in code
self._code = py_compile(self.python, pyfile, 'exec')
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
compiler.py", line 108, in python
py = kid.parser.parse_file(self.kid_file, self.encoding)
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
parser.py", line 58, in parse_file
return parse(source, encoding, filename=filename)
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
parser.py", line 46, in parse
return parser.parse()
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
parser.py", line 76, in parse
self.proc_stream(self.module_code)
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
parser.py", line 133, in proc_stream
for (ev, item) in self.stream:
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
pull.py", line 168, in _track
for p in stream:
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
pull.py", line 210, in _coalesce
for ev, item in stream:
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
pull.py", line 374, in __iter__
for (ev, stuff) in self._expat_stream():
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
pull.py", line 346, in _expat_stream
feed(data)
File "/sw/lib/python2.4/site-packages/kid-0.9.3-py2.4.egg/kid/
pull.py", line 414, in feed
raise e
ExpatError: not well-formed (invalid token): line 2, column 77
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---