[Zope] Python Methods can't construct literal dictionaries?

2001-01-28 Thread Fred Yankowski

I'm trying to create a Python Method, using PythonMethod 0-1-7, that
validates a set of form values before updating a database.  I planned
to return any/all errors as a dictionary keyed by the errant field
name.  But statements like this in my Python Method

input_errors = {}
input_errors['password'] = "password must not be empty"
...
return input_errors

result in the following error when I try to save the change to the code:

Error Type: Python Method Error
Error Value: Forbidden operation STORE_SUBSCR at line 3

What's up with that?  I can't create dictionaries in Python Methods?
I must be missing something.  Is there some way around this?

-- 
Fred Yankowski   [EMAIL PROTECTED]  tel: +1.630.879.1312
Principal Consultant www.OntoSys.com   fax: +1.630.879.1370
OntoSys, Inc 38W242 Deerpath Rd, Batavia, IL 60510, USA

___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )




Re: [Zope] Python Methods can't construct literal dictionaries?

2001-01-28 Thread Evan Simpson

This is one of the shortcomings of Python Methods that Scripts eliminate.
You can work around it by writing:

x = {}
x.update({y: z})

Cheers,

Evan @ digicool  4-am


___
Zope maillist  -  [EMAIL PROTECTED]
http://lists.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://lists.zope.org/mailman/listinfo/zope-announce
 http://lists.zope.org/mailman/listinfo/zope-dev )