I have created a class with a __call__ method that returns the custom form template, and a nextURL() method. In the configuration file I have replaced the content_factory directive with the class directive.
With the custom form and class, the form displays and field validation still works, but with valid fields I get an object creation error:
File "/usr/local/Zope3/src/zope/app/form/browser/add.py", line 71, in create return self._factory(*args, **kw) TypeError: 'NoneType' object is not callable
I have looked at the add.py module and am none the wiser. I guess I have neglected to set something somewhere, may be context related. Can anyone enlighten me? The custom class has almost nothing in it (see below) so I am surprised it gets as far as it does. [I have also searched the archives and read both recent Zope3 books but can't find an answer.]
from zope.app.pagetemplate.viewpagetemplatefile import ViewPageTemplateFile
class PageAddFormD: """This class reads the form data and creates a custom Page"""
template = ViewPageTemplateFile('pageaddformd.pt')
def __call__(self): return self.template()
def getInterfaces(self): """ Don't know if I need this here """ return implementedBy(GlgPage)
def nextURL(self): """ return the next place to go """ # have not got this far yet return '../' _______________________________________________ Zope3-users mailing list Zope3firstname.lastname@example.org http://mail.zope.org/mailman/listinfo/zope3-users