[Zope] Add a property with a class constructor

Hervé Richard richard@avignon.inra.fr
Wed, 25 Apr 2001 15:45:00 +0200


Hi Dieter, 

thank you for your help but something is wrong with me :

Le Samedi 14 Avril 2001 20:21, Dieter Maurer a écrit :
> Herve Richard writes:
>  > In a foder i can write a dtml-method like this, but from the constru=
ctor
>  > ?
>  >
>  >     <dtml-with "PARENTS[0]">
>  >       ...
>
> You replace "PARENTS[0]" with the newly created object
>
> Your object must be a PropertyManager for the "manage_addProperty"
> to be available.

Ok, i understand the scheme

> Otherwise, you may need to add properties to a property sheet.
> See embedded Zope Online Help --> Zope Help --> API Reference --> *

 Yes, i try, but i don't find all help i need : for example when you create a 
new class,  the default script class constructor use the function 
CreateInObjectManager(...) :

<dtml-with "TotoClass.createInObjectManager(REQUEST['id'], REQUEST)">

But when i read the online help (Zope 2.3) i see :

ObjectManager 

     An ObjectManager contains other Zope objects. The
     contained objects are Object Manager Items.

     Creating Objects in an ObjectManager

     To create an object inside an object manager use
     manage_addProduct:

             self.manage_addProduct['OFSP'].manage_addFolder(id, title)


     In DTML this would be:
               
<dtml-call"manage_addProduct['OFSP'].manage_addFolder(id,title)">

 .....


Probably something is missing to me, it seem like 2 methods to do the same 
thing :
-  createInObjectManager(..)
-  manage_addProduct['OFSP'].manage_addFolder(id, title)

where is the difference ?
I don't find the doc which synthesize all the ways ! 
any URL ?

Thank's a lot

> whether PropertySheets support adding new preperties.
>

( 
> Otherwise, you may need to add properties to a property sheet.
In this case i think it is not possible because i want to add a different 
number of properties each time i create a new object.
)
>
> Dieter

-- 

    Herve RICHARD
   INRA - Biometrie		tel: 04 32 72 21 79
         AgroParc      		Prof. email: Herve.Richard@avignon.inra.fr
 84914 AVIGNON cedex 9		Priv. email: rv.richard@oreka.com