[ZDP] BackTalk to Document The Zope Book (2.5 Edition)/Using Basic Zope Objects

nobody@nowhere.com nobody@nowhere.com
Tue, 10 Sep 2002 17:38:49 -0400


A comment to the paragraph below was recently added via http://www.zope.org/Documentation/Books/ZopeBook/current/BasicObject.stx#2-60

---------------

    As we said earlier, the possibilities for using scripts is almost
    endless.  This example, however, gives you a good idea of the most
    common pattern for *presentation* objects to collect and display
    information, and using *business logic* objects to make
    calculations.

      % Anonymous User - Sep. 10, 2002 5:38 pm:
       Would somebody PLEASE give me an example of how to alter an object's property? from a ScriptPython? from a
       PageTemplate? from a DTML<yuk>method?
       Example, I am the Owner of a folderish object with a property of id:Num, type:int, value:2000

       I would like to be able to CHANGE the value, not display it, nor use it.

       When I try from a PythonScript located in the folder...
          container.Num = 2002
       I get
          Error Value: attribute-less object (assign or del)

       This would be valid python code outside of Zope, and is the standard way to assign a variable. Is there some
       secret API I haven't found?