Re: [Zope] manage_editProperties Question

2001-01-05 Thread Dieter Maurer

Ronald L. Roeber writes:
 >  self.manage_editProperties(REQUEST=None,contact=newcontact)
 >  ...
 > 
 > Error Type: TypeError
 > Error Value: unexpected keyword argument: contact

"manage_editProperties" has the following signature:

def manage_editProperties(self, REQUEST)

As you see, there is indeed no parameter named "contact".

You can do instead:

  self.manage_editProperties({'contact' : newcontact})

This means, you build a dictionary with the new property
values and pass it as REQUEST.


Be WARNED:

   "manage_editProperties" changes *ALL* properties
   of your object, even those not mentioned in the
   dictionary!

What you may want to use instead is "manage_changeProperties".
It will change just the mentioned properties, 'contact'
in your example.


I think, you find this information in the Zope integrated
help system (API Reference, Property Manager).
If not, then look at the source: OFS.PropertyManager.PropertyManager.
It contains good source documentation.


Dieter


___
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 )




[Zope] manage_editProperties Question

2001-01-05 Thread Ronald L. Roeber

I have looked through the Zope book and other documentation, but still
am unable to properly allow others to change properties in a product
with a custom built form.

Case in point, a product with a Property called

contact
which is a string

The product changing method  I am trying to make work contains the
following

def editProductInfo(self, newcontact):
 ...
 self.manage_editProperties(REQUEST=None,contact=newcontact)
 ...

Which is not correct obiously since it generates the following error:

Error Type: TypeError
Error Value: unexpected keyword argument: contact

--

TIA for helping someone so slow as myself...

Ron Roeber
University of Nebraska



___
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 )