#917: Comment on docs/tutorials/wiki20/page3.html
-----------------------------------+----------------------------------------
Reporter: [EMAIL PROTECTED] | Owner: anonymous
Type: defect | Status: reopened
Priority: normal | Milestone:
Component: Docs | Version: 0.9a6
Severity: normal | Resolution:
Keywords: |
-----------------------------------+----------------------------------------
Changes (by barryh):
* version: 0.9a5 => 0.9a6
* status: closed => reopened
* resolution: invalid =>
Comment:
I don't think this person was looking at the wrong docs. I experienced
the same thing in 0.9a6, as did the user in #956. The tutorial calls for
a save method with the signature {{{save(self, pagename, data)}}}, but you
get a TypeError when you do that:
{{{
Page handler: <bound method Root.save of <wiki20.controllers.Root object
at 0xa73bdacc>>
Traceback (most recent call last):
File "/var/lib/python-support/python2.4/cherrypy/_cphttptools.py", line
105, in _run
self.main()
File "/var/lib/python-support/python2.4/cherrypy/_cphttptools.py", line
254, in main
body = page_handler(*virtual_path, **self.params)
File "<string>", line 3, in save
File "/var/lib/python-support/python2.4/turbogears/controllers.py", line
273, in expose
output = database.run_with_transaction(
File "/var/lib/python-support/python2.4/turbogears/database.py", line
221, in run_with_transaction
retval = func(*args, **kw)
File "<string>", line 5, in _expose
File "/var/lib/python-support/python2.4/turbogears/controllers.py", line
290, in <lambda>
mapping, fragment, *args, **kw)))
File "/var/lib/python-support/python2.4/turbogears/controllers.py", line
314, in _execute_func
output = errorhandling.try_call(func, *args, **kw)
File "/var/lib/python-support/python2.4/turbogears/errorhandling.py",
line 71, in try_call
return func(self, *args, **kw)
TypeError: save() got an unexpected keyword argument 'submit'
}}}
A fourth argument is needed, even though we do nothing with it. A method
signature of {{{save(self, pagename, data, submit)}}} allows the save
function to work fine; it seems that the submit button is being added to
the submission just like the other form fields, so the save method has to
allow for that. I have checked the documentation referenced above in
Subversion, and it's the same as what's on the site. Please see my
comments on #956 and see if the tutorial needs to be udpated for that
particular item, the addition of the save action to controllers.py.
Thanks in advance for your time.
--
Ticket URL: <http://trac.turbogears.org/turbogears/ticket/917>
TurboGears <http://www.turbogears.org/>
TurboGears front-to-back web development
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"TurboGears Tickets" 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-tickets
-~----------~----~----~----~------~----~------~--~---