[Zope] manage_changeProperties

kent sin kentsin@yahoo.com
Thu, 12 Jul 2001 02:36:22 -0700 (PDT)


WHY

doc.manage_changeProperties(listProperty=1)

 works but

doc.manage_changeProperties({'listProperty':1}) 

doesn't ?

I was using Zope 2.4 B1 on win32:

import sys
sys.path.insert(0,'zope')
sys.path.insert(0,'zope/lib/python')
import ZServer
import Zope
from AccessControl.SecurityManagement import
newSecurityManager
app = Zope.app()
uf=app.acl_users
user = uf.getUser('root').__of__(uf)
newSecurityManager(None,user)
doc=app['doc']
doc.manage_changeProperties({'listProperty':1})

I can not use
manage_changeProperties(propertyname=val) 
because I got the property name from another variable,
I intend to use manage_changeProperty({var:val}) for
the actual call.


Trace is below : 

>>> doc.manage_editProperties({'listProperty':1})
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File
"C:\PROGRA~1\zope\lib\python\OFS\PropertyManager.py",
line 339, in manage
_editProperties
    manage_tabs_message=message)
  File
"C:\PROGRA~1\zope\lib\python\Shared\DC\Scripts\Bindings.py",
line 324, in
 __call__
    return self._bindAndExec(args, kw, None)
  File
"C:\PROGRA~1\zope\lib\python\Shared\DC\Scripts\Bindings.py",
line 354, in
 _bindAndExec
    return self._exec(bound_data, args, kw)
  File
"C:\PROGRA~1\zope\lib\python\App\special_dtml.py",
line 241, in _exec
    try: result = render_blocks(self._v_blocks, ns)
  File
"C:\PROGRA~1\zope\lib\python\DocumentTemplate\pDocumentTemplate.py",
line
 261, in render_blocks
    if type(section) is StringType:
section=md[section]
  File
"C:\PROGRA~1\zope\lib\python\DocumentTemplate\pDocumentTemplate.py",
line
 217, in __getitem__
    return v.__render_with_namespace__(self)
  File
"C:\PROGRA~1\zope\lib\python\Shared\DC\Scripts\Bindings.py",
line 338, in
 __render_with_namespace__
    return self._bindAndExec((), namevals, namespace)
  File
"C:\PROGRA~1\zope\lib\python\Shared\DC\Scripts\Bindings.py",
line 354, in
 _bindAndExec
    return self._exec(bound_data, args, kw)
  File
"C:\PROGRA~1\zope\lib\python\App\special_dtml.py",
line 241, in _exec
    try: result = render_blocks(self._v_blocks, ns)
  File
"C:\PROGRA~1\zope\lib\python\DocumentTemplate\pDocumentTemplate.py",
line
 297, in render_blocks
    section=section(md)
  File
"C:\PROGRA~1\zope\lib\python\DocumentTemplate\DT_Let.py",
line 147, in re
nder
    else: d[name]=expr(md)
  File
"C:\PROGRA~1\zope\lib\python\DocumentTemplate\DT_Util.py",
line 228, in e
val
    return eval(code, d)
  File "<string>", line 0, in ?
AttributeError: 'None' object has no attribute 'get'

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/