[Zope] PropertyManager, Forms

THerp@apriori.de THerp@apriori.de
Tue, 14 Jan 2003 15:32:32 +0100


Hi,

I have a very strange problem here, driving me nuts:

I have a class, derived from PropertyManager (and mixed in to several
others instead of PropertyManager); it redefines PropertyMap to allow
filtering by prefixes, but mainly adds new methods to work on the
properties in a self-written administration interface. As a goodie, it
supports the additional property keys 'descr' and 'title'. For them, an=
d
because I don't want to affect the ZMI functions, I need the methods
'admin_addProperty' and 'admin_changeProperties'.

Problem is, they aren't called properly.

As far as possible, I did it like ZMI does. The resulting HTML looks li=
ke
this (entry fields omotted for clarity):

<form action=3D"http://complete.url/of/folderish/object/to/be/changed" =
method
=3D"post">
(... entry fields for existing properties)
<input type=3D"submit" name=3D"admin_changeProperties:method"
       class=3D"form-element" value=3D"Change" />
</form>
(...)
<form action=3D"
http://complete.url/of/folderish/object/to/be/changed/admin_addProperty=
"
method=3D"post">
(... entry fields for a new property ...)
<input class=3D"form-element" type=3D"submit" name=3D"submit" value=3D"=
 Add " />
</form>

First I tried to define admin_addProperty exactly like manage_addProper=
ty
(args: self, id, value, type, REQUEST=3DNone), adding two additional op=
tional
arguments at the end. This yields:

     admin_addProperty() takes at least 4 arguments (3 given)

It seems to me that "self, REQUEST, RESPONSE" are handed over, because

     def admin_addProperty(self, REQUEST=3DNone, RESPONSE=3DNone):
          raise Exception('request: %s' % `REQUEST.items()`) # debug

yields a beautyful REQUEST featuring all I need, BUT: I can't use it. I=
t
won't admit it has a get method (AttributeError).

What the hell is wrong here?

Is it because of a wrong name/prefix? (but I tried manage_admin_...
manage_admin... as well, they don't work either)

Any ideas?

tia,

Tobias
--
If there is some unfriendly text appended, please ignore it and blame L=
otus
Notes R5.0.5:


Diese E-Mail enth=E4lt vertrauliche und/oder rechtlich gesch=FCtzte
Informationen. Wenn Sie nicht der richtige Adressat sind oder
diese E-Mail irrt=FCmlich erhalten haben, informieren Sie bitte
sofort den Absender und vernichten Sie diese Mail. Das un-
erlaubte Kopieren sowie die unbefugte Weitergabe dieser Mail
ist nicht gestattet.

This e-mail may contain confidential and/or privileged
information. If you are not the intended recipient (or have
received this e-mail in error) please notify the sender
immediately and destroy this e-mail. Any unauthorised copying,
disclosure or distribution of the material in this e-mail is
strictly forbidden.=