z3c.form render template bug
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
z3c.form |
Won't Fix
|
Undecided
|
Unassigned |
Bug Description
In trying to work out how to traverse from a z3c.form Form for a simple scenario, I've uncovered something a little confusing with the Form code.
In my case the user specifies search criteria then gets a results page. I am doing the following;
from z3c.form import form
from zope.app.
class SearchForm(
# usual stuff
fields=...
def @handleSearch(self, action):
# process criteria and setup for displaying results
...
self.template = ViewPageTemplat
Which breaks because of BaseForm's render() method (see comments):
def render(self):
'''See interfaces.IForm'''
# render content template
if self.template is None:
template = zope.component.
return template(self) # ** displays ok default edit form
return self.template() # ** breaks results page no instance
Should the last line be self.template(self) because ViewPageTemplat
Although ViewPageTemplat
affects: | zope3 → z3c.form |
Changed in z3c.form: | |
status: | New → Won't Fix |
On Tuesday 24 March 2009, nick wrote: eFile._ _call__ (self, instance, *args **kw) requires a
> Should the last line be self.template(self) because
> ViewPageTemplat
> single mandatory argument?
No, because ViewPageTemplat eFile can only be used on the class level. You need mplateFile inside a method.
to use BoundViewPageTe
Regards,
Stephan
--
Stephan Richter
Web Software Design, Development and Training
Google me. "Zope Stephan Richter"