----- Original Message ----- From: "Dieter Maurer" <dieter@handshake.de> To: "Jonathan" <dev101@magma.ca> Cc: <zope@zope.org> Sent: Sunday, March 11, 2007 3:13 PM Subject: Re: [Zope] External Methods and Authentication error
External Method:
# threadFolder is a BTreeFolder2; viewCount is a property field on the BTreeFolder2
line 3227: threadFolder = self.unrestrictedTraverse(topFolder + forumId + '/' + threadId) line 3228: threadFolder.manage_changeProperties({'viewCount': threadFolder.viewCount+1})
OFS/PropertyManager.py
line 299: def manage_changeProperties(self, REQUEST=None, **kw): ... line 317: if REQUEST: line 318: message="Saved changes." line 319: return self.manage_propertiesForm(self,REQUEST, line 320: manage_tabs_message=message)
I see: the "DTML" object is "manage_propertiesForm" and there is no nameclash.
The "manage_changeProperties" method has a somewhat awkward behaviour. In general, you should not pass it a positional argument but always keyword arguments. If you pass a positional argument, it takes it for "REQUEST" and usually does the wrong thing.
If you have the arguments in a dictionary "d", use "manage_changeProperties(**d)".
Thanks Dieter, that makes sense and clears up the situation entirely! Jonathan