[Zope-CMF] Portal users and some other stuff

Charlie Clark charlie at begeistert.org
Fri Jan 12 06:26:47 EST 2007


Am 12.01.2007 um 10:13 schrieb Jens Vagelpohl:

> That's a matter of taste. I like explicit, so I prefer the existing  
> method.

Explicit is better than implicit but I don't see what's wrong with  
having an explicit list of fields through which to loop, as long as  
the call is the same as this reduces typos and makes things easier to  
manage. Of course, exposing all attributes by allowing __get__ to be  
the same as getattr can cause problems for objects that are not  
simply based on dictionaries.
>
>
>> I was initially confused that the context was the same as the  
>> instance of my content-type and didn't support this as I use this  
>> idiom quite frequently to reduce my typos. Is this too much of an  
>> edge case to warrant the extension in general (but I'm free to do  
>> it myself) or perhaps an outdated methodology?
>
> I'm not sure what this paragraph means.

It was quite late...

In PythonScripts I quite often use
context.get('objectname') rather than context.objectname for anything  
programmatic. It seems to me that there is a case for making certain  
attributes of content-types available via get so that dispatching can  
be used where appropriate.

>
>
>> If I need to add attributes to portal users such as their full  
>> name, is it best to customise the member object for my site or to  
>> use a plugin?
>
> All you need to do is to add the desired property to the list of  
> properties in the member data tool, and then extend the preferences  
> form and its handlers with your new property (untested off the top  
> of my head).

Thanks. Works as expected.

Charlie

--
Charlie Clark
Helmholtzstr. 20
Düsseldorf
D- 40215
Tel: +49-211-938-5360
GSM: +49-178-782-6226





More information about the Zope-CMF mailing list