[Zope] Still Chipping Away At Formulator/ZPT Interface

beno zope@thewebsons.com
Tue, 05 Nov 2002 21:45:45 -0400


At 06:53 PM 11/5/2002 -0600, you wrote:

>     >> from Products.Formulator.Errors import ...
>
>     beno> Hmmm. Went there. Was referred to a file called *Errors.py* in
>     beno> Formulator.  File doesn't exist. Noticed the thread was recent and
>     beno> the author was the author of the program. What did I miss?!
>
>Depending how your directory tree is set up, you may have to look in more
>than one place.  I have a binary Plone installed (MacOSX).  It has the
>following relevant directories:
>
>     /Applications/Plone/PloneInstance/Products
>     /Applications/Plone/Zope/lib/python/Products

I d'l'd the latest version and found an Errors.py file (so I must have had 
an old version). This is what it reads:

"""Exception Classes for Formulator"""

# These classes are placed here so that they can be imported into TTW Python
# scripts. To do so, add the following line to your Py script:
# from Products.Formulator.Errors import ValidationError, FormValidationError

from Products.PythonScripts.Utility import allow_class

class FormValidationError(Exception):

     def __init__(self, errors, result):
         Exception.__init__(self,"Form Validation Error")
         self.errors = errors
         self.result = result

allow_class(FormValidationError)

class ValidationError(Exception):

     def __init__(self, error_key, field):
         Exception.__init__(self, error_key)
         self.error_key = error_key
         self.field_id = field.id
         self.field = field
         self.error_text = field.get_error_message(error_key)

allow_class(ValidationError)

So I did as instructed, added this line:
from Products.Formulator.Errors import ValidationError, FormValidationError
and now it wants me to authenticate! Why? I changed the security on *access 
contents information* to *anonymous* just to see if that was it, but no. 
What do?
TIA,
beno