[Setup] Accessing custom memberdata

audleman kevin.audleman at gmail.com
Mon Jun 15 16:42:56 UTC 2009


Raphael,

Cheers, this solved my problem. Actually, I discovered that the variable 
"member" was already set, so all I had to do was use it.

I'll post questions like this to plone-users next time, thanks for 
letting me know where to post.

Thanks,
Kevin

Raphael Ritz (via Nabble) wrote:
> audleman wrote:
>
> > Hello all,
> >
> > I have added a few properties to my memberdata, namely 
> "organization" and
> > "region." I am trying to update the author.cpt template (e.g. what 
> you see
> > when you click on a users name anywhere in the site) to display 
> these new
> > fields but have run into a stumbling block. This template calls the 
> function
> > mtool.getMemberInfo to bring in member properties but it doesn't 
> include any
> > custom. Indeed, I checked out the documentation for the function in
> > MembershipTool.py and the function politely tells me
> >
> > """
> > Return 'harmless' Memberinfo of any member, such as Full name, 
> Location,
> > etc.
> > """
> >
> > So how do I gain access to my additional properties?
> >
> > The author.cpt template has the following defined:
> >
> > mtool - I assume this means membership tool
> > author - A string with the author name
> >
> > I would think I should try to get the member object then call
> > member.getProperty for each of my properties. However I don't know 
> how to
> > get the member object.
> >
>
> context.portal_membership.getMemberById(<some member id string>)
>
> note, however, that this returns the fully decorated member
> object including potentially sensitive info. Therefore, this
> call is protected by the 'Manage portal' permission.
>
> Alternatively, you can patch the 'getMemberInfo' method to include
> your custom properties.
> Or you write a custom method in trusted code (file system) based
> on the above.
>
> HTH
>
>         Raphael
>
> BTW: stuff like that isn't exactly setup/installation related and
> could also be asked on 'plone-users' where more people would see it.
>
>
>
> > Any help greatly appreciated.
> >
> > Thanks,
> > Kevin
>
>
> _______________________________________________
> Setup mailing list
> Setup at ... 
> <http://n2.nabble.com/user/SendEmail.jtp?type=node&node=3066343&i=0>
> http://lists.plone.org/mailman/listinfo/setup
>
>
> ------------------------------------------------------------------------
> This email is a reply to your post @ 
> http://n2.nabble.com/Accessing-custom-memberdata-tp3063133p3066343.html
> You can reply by email or by visting the link above.
>

-- 
View this message in context: http://n2.nabble.com/Accessing-custom-memberdata-tp3063133p3081304.html
Sent from the Installation, Setup, Upgrades mailing list archive at Nabble.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.plone.org/pipermail/setup/attachments/20090615/8583dae8/attachment.htm


More information about the Setup mailing list