Wierdness with ZCatalogedObject product
This one must be obvous, but it's sure got me ! ZCatalogedObject product, on pristine Zope2.5.1 win binary ditribution. Where tstObject is an instance of ZcatalogedObject, calling (from a python script): container.tstObject.manage_changeProperties({'prop1':999}) gets me a TypeError, manage_changeProperties() takes at most 2 arguments (3 given) on the line where PropertyManager.manage_changeProperties() is called from within ZcatalogedObject.manage_changeProperties(). Signatuere is the same for both. At this point I solicit tips for what could be causing this message, which appers to be manifest rubbish to me (at least after breaking my brains on this one for so long). Can't see the wood for the trees, probably! Thanks in advance, N.
Nigel Head wrote:
container.tstObject.manage_changeProperties({'prop1':999})
gets me a
TypeError, manage_changeProperties() takes at most 2 arguments (3 given)
Isn't it because you need to set the value in the request, and then pass that? like:: REQUEST.set('prop1',999) container.tstObject.manage_changeProperties(REQUEST=REQUEST) regards Max M -- "Sorry I would Really Like To Help More On This Project, But Am To Busy Doing Paid Work On A Tight Deadline" Max M
Salut, simple and short question but essential to my project... is there a way to take away an assigned role from a user ? Thanks, Jens. -- "La raison connaît le chemin, la volonté est ma force, l'émotion me fait avancer, mais la peur m'en empêche." Camouflage
go into the userfolder, select the user and change the roles. jens On Sunday, August 11, 2002, at 01:34 , Jens Dobberthin wrote:
Salut,
simple and short question but essential to my project... is there a way to take away an assigned role from a user ?
Thanks, Jens.
to be more precise... Assume the following path a/b/c where <a> contains the user folder. I assign some roles to a user in <a>, but in <b> I want to take away one role. Is that possible ? BTW, I testet the NuxUserGroups-Product. Having groups is a very nice feature and very essential to a CMS. But it lacks in one way: there is no clear relation between groups and roles. What do I need: Usally, a user can be assigned to one or more groups and in every group he has one ore more roles. Then I can grant (or deny) access to a folder because of the membership to a group. The permissions that users have in this folder are derived from the roles of that group that I granted access to. One advantage is that I have central place to manage my users and their permissions. Viele Grüße, Jens. On Sunday 11 August 2002 22:04, you wrote:
go into the userfolder, select the user and change the roles.
jens
On Sunday, August 11, 2002, at 01:34 , Jens Dobberthin wrote:
Salut,
simple and short question but essential to my project... is there a way to take away an assigned role from a user ?
Thanks, Jens.
Max M wrote:
Nigel Head wrote:
container.tstObject.manage_changeProperties({'prop1':999})
gets me a TypeError, manage_changeProperties() takes at most 2 arguments (3 given)
Isn't it because you need to set the value in the request, and then pass that?
Any mapping should do, unless ZCataloguedObject's manage_changeProperties works differently to a normal PropertyManager. Nigel, Can you post the code of ZCataloguedObject's manager_changeProperties method? cheers, Chris
On Sun, 11 Aug 2002 14:25:12 +0100 Chris Withers <chrisw@nipltd.com> wrote:
Can you post the code of ZCataloguedObject's manager_changeProperties method?
Sure, should have done that first time ..... N. ======================================================= security.declareProtected(Permission, "manage_changeProperties") def manage_changeProperties(self, REQUEST=None, **kw): "override PropertyManager management methods to mixin catalog awareness" try: PropertyManager.manage_changeProperties(self, REQUEST, kw) finally: self.reindex_object() if REQUEST is not None: message="Saved changes." return self.manage_propertiesForm(self, REQUEST, manage_tabs_message=message)
Nigel Head wrote:
security.declareProtected(Permission, "manage_changeProperties") def manage_changeProperties(self, REQUEST=None, **kw): "override PropertyManager management methods to mixin catalog awareness" try: PropertyManager.manage_changeProperties(self, REQUEST, kw)
shouldn't that be:: PropertyManager.manage_changeProperties(self, REQUEST, **kw) Else you are just passing it a dict. regards Max M -- "Sorry I would Really Like To Help More On This Project, But Am To Busy Doing Paid Work On A Tight Deadline" Max M
Nigel Head writes:
On Sun, 11 Aug 2002 14:25:12 +0100 Chris Withers <chrisw@nipltd.com> wrote:
Can you post the code of ZCataloguedObject's manager_changeProperties method?
Sure, should have done that first time .....
N. PropertyManager.manage_changeProperties(self, REQUEST, kw) Try:
apply(PropertyManager.manage_changeProperties,(self,REQUEST,),kw) Dieter
On Sun, 11 Aug 2002 20:03:11 +0200 Dieter Maurer <dieter@handshake.de> wrote:
apply(PropertyManager.manage_changeProperties,(self,REQUEST,),kw)
Aaarrgh !!! I KNEW it had to be obvious! This looks like it should do the job; I'll give a go when I hit the office today but I seem to rmember falling in this hole before, many moons ago :-( !! Those keyword args are one of the bits of python I hardly ever use ..... Thanks Dieter, Chris, Max, N:
participants (7)
-
Chris Withers -
Dieter Maurer -
Jens Dobberthin -
Jens Dobberthin -
Jens Vagelpohl -
Max M -
Nigel Head