[Zope] addProperty type=selection (half fixed)

Lee Marzke lmarzke@adelphia.net
Wed, 11 Apr 2001 10:56:29 -0400


I added quotes around 'mytypes' and the error went away.  I guess that
"selection" needs a variable name, not it's value.

<dtml-call "manage_addProperty( 'Type', 'mytypes', type='selection' ) " >

Now I am trying to set the value of property 'Type' :

<dtml-call "manage_changeProperties( Type=selectedType ) " >

This doesn't give an error, but the Type property is always the first listed
in the associated lines property, and never changes.

Is the syntax for manage_changeProperties correct ?

Thanks,

Lee Marzke <lmarzke@adelphial.net>

At 09:12 AM 4/11/01 -0400, you wrote:
>Hi,
>
>I'm having problems programming something that works from the user Interface,
>
>Root folder has a property "mytypes" of type lines,  with three items
>
> From the management interface I can add a property to a method
>foo,  value=myypes,  type=selection
>
>This works and the Property interface shows all the types correctly.
>
>However I want to create a new method with the selected property.
>My method creates a method using manage_addDTMLDocument()
>
>I then call
><dtml-call "manage_addProperty( 'Type', mytypes, type='selection' ) " >
>
>And I get the following error.
>
>Notice that the above adding the Property with an unselected option.
>Do I have to also follow this with a changeProperty call ?
>
>Thanks,
>
>Lee Marzke <lmarzke@adelphia.net>
>
>Zope Error
>
>Zope has encountered an error while publishing this resource.
>
>Error Type: TypeError
>Error Value: hasattr, argument 2: expected string, list found
>
>Troubleshooting Suggestions
>The URL may be incorrect.
>The parameters passed to this resource may be incorrect.
>A resource that this resource relies on may be encountering an error.
>
>For more detailed information about the error, please refer to the HTML 
>source for this page.
>
>If the error persists please contact the site maintainer. Thank you for 
>your patience.
>
>[Powered by Zope]
>
>Traceback (innermost last):
>   File /home/httpd/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 
> 222, in publish_module
>   File /home/httpd/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 
> 187, in publish
>   File /home/httpd/Zope-2.3.0-src/lib/python/Zope/__init__.py, line 221, 
> in zpublisher_exception_hook
>     (Object: Traversable)
>   File /home/httpd/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 
> 171, in publish
>   File /home/httpd/Zope-2.3.0-src/lib/python/ZPublisher/mapply.py, line 
> 160, in mapply
>     (Object: addCfiAction)
>   File /home/httpd/Zope-2.3.0-src/lib/python/ZPublisher/Publish.py, line 
> 112, in call_object
>     (Object: addCfiAction)
>   File /home/httpd/Zope-2.3.0-src/lib/python/OFS/DTMLMethod.py, line 189, 
> in __call__
>     (Object: addCfiAction)
>   File 
> /home/httpd/Zope-2.3.0-src/lib/python/DocumentTemplate/DT_String.py, line 
> 538, in __call__
>     (Object: addCfiAction)
>   File /home/httpd/Zope-2.3.0-src/lib/python/DocumentTemplate/DT_With.py, 
> line 146, in render
>     (Object: instructors)
>   File /home/httpd/Zope-2.3.0-src/lib/python/DocumentTemplate/DT_With.py, 
> line 146, in render
>     (Object: _.getitem(CfiId))
>   File /home/httpd/Zope-2.3.0-src/lib/python/DocumentTemplate/DT_Util.py, 
> line 334, in eval
>     (Object: manage_addProperty('Type', mytypes, type='selection'))
>     (Info: manage_addProperty)
>   File <string>, line 0, in ?
>   File /home/httpd/Zope-2.3.0-src/lib/python/OFS/PropertyManager.py, line 
> 314, in manage_addProperty
>     (Object: 986995749)
>   File /home/httpd/Zope-2.3.0-src/lib/python/OFS/PropertyManager.py, line 
> 247, in _setProperty
>     (Object: 986995749)
>TypeError: (see above)
>
>
>_______________________________________________
>Zope maillist  -  Zope@zope.org
>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 )