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 #272 (closed defect: fixed)

Opened 13 years ago

Last modified 12 years ago

turbogears.fastdata.DataController aborting when there's a 'title' attribute for a column

Reported by: Jorge Godoy <jgodoy@…> Owned by: anonymous
Priority: high Milestone: 0.9
Component: TG Widgets Version:
Severity: major Keywords: develix
Cc:

Description

When specifying a 'title' attribut on any column displayed with turbogears.fastdata.DataController it bails out with the following traceback:

Traceback (most recent call last):

File "/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 271, in run

main()

File "/usr/lib/python2.4/site-packages/CherryPy-2.1.0-py2.4.egg/cherrypy/_cphttptools.py", line 502, in main

body = page_handler(*args, cherrypy.request.paramMap)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 220, in newfunc

html, *args, kw)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/database.py", line 174, in run_with_transaction

retval = func(*args, kw)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 246, in _execute_func

output = func(self, *args, kw)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/fastdata/datacontroller.py", line 114, in default

return method(item, *vpath[1:], params)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 223, in newfunc

tg_format, html, *args, kw)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 249, in _execute_func

return _process_output(tg_format, output, html)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/controllers.py", line 64, in _process_output

output = view.render(output, tg_format, template=template)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/view.py", line 55, in render

return engine.render(info, format, fragment, template)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/kidsupport.py", line 106, in render

return t.serialize(encoding=self.defaultencoding, output=format, fragment=fragment)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/init.py", line 232, in serialize

return serializer.serialize(self, encoding, fragment)

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/serialization.py", line 51, in serialize

text = list(self.generate(stream, encoding, fragment))

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/serialization.py", line 157, in generate

for ev, item in self.apply_filters(stream):

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/serialization.py", line 84, in balancing_filter

for ev, item in stream:

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/pull.py", line 203, in _coalesce

for ev, item in stream:

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/filter.py", line 21, in transform_filter

for ev, item in apply_matches(stream, template, templates, apply_func):

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/filter.py", line 31, in apply_matches

item = stream.expand()

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/pull.py", line 95, in expand

for ev, item in self._iter:

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/pull.py", line 164, in _track

for p in stream:

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/pull.py", line 203, in _coalesce

for ev, item in stream:

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/turbogears/fastdata/templates/form.py", line 53, in _pull File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/filter.py", line 21, in transform_filter

for ev, item in apply_matches(stream, template, templates, apply_func):

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/filter.py", line 25, in apply_matches

for ev, item in stream:

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/pull.py", line 164, in _track

for p in stream:

File "/home/godoy/desenvolvimento/python/TurboGears/trunk/thirdparty/kid/kid/pull.py", line 203, in _coalesce

for ev, item in stream:

File "<string>", line 56, in _pull

AttributeError?: 'str' object has no attribute 'insert'

Removing the 'title' attribute from the column fixes the problem but doesn't allow specifying the label that should be presented to the user.

Change History

comment:1 Changed 13 years ago by anonymous

  • Milestone set to 0.9

comment:2 Changed 13 years ago by kevin

Dan Jacob also reports:

When using the TextField widget if the name parameter is "title" it
creates the following default value:

<INPUT TYPE="text" NAME="title" VALUE="<built-in method title of str
object at 0x009BA038>">

comment:3 Changed 13 years ago by kevin

  • Keywords develix added

comment:4 Changed 13 years ago by Mike Kent <mrmakent@…>

I found the cause of this bug (see  http://groups.google.com/group/turbogears/browse_frm/thread/60f8c54aaf005dfe/14d3929c1d0f5114#14d3929c1d0f5114), but since I'm not clear on the reason for this bugged code being there, do not yet have a patch.

comment:5 Changed 13 years ago by alberto

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

This is working correctly (both the original subject and the problem descibed by Dan Jacob) in the new widgets API. I've committed two tests at r713 which prove it (If I didn't misinterpret this ticket).

Shall we make a lottery for the bounty? :D

Note: See TracTickets for help on using tickets.