[Zope-CMF] [dev] renaming /Members: a small proposal

Yuppie schubbe@web.de
Mon, 10 Feb 2003 14:31:25 +0100


Hi Tres!


Tres Seaver wrote:
>>and add these methods to the portal_membership interface:
>>
>>     def setMembersFolder(id='Members'):
>>         """ Set the members folder object.
>>
>>         The members folder has to be in the same container as the
>>         membership tool. id is the id of an existing folder. If id is
>>         None, member areas are disabled.
>>
>>         Permission -- Manage portal
>>         """
>>
>>     def getMembersFolder():
>>         """ Get the members folder object.
>>
>>         If no members folder is set or the set folder id doesn't exist,
>>         None is returned.
>>
>>         Permission -- Always available
>>
>>         Returns -- Members folder object or None
>>         """
> 
> 
> I wouldn't add this to the "required" interface (in
> CMFCore.interfaces.portal_membership), as it represents an API which may
> not be present on some implementations of the tool.  The "correct"
> location for this would be in CMFDefault.interfaces.portal_membership,
> which would then be like:
> 
> 
>  from Products.CMFCore.interfaces.portal_membership \
>      import MembershipTool as BaseTool
> 
>  class MembershipTool( BaseTool ):
> 
>      """ Declare product-specific APIs for CMFDefault's tool.
>      """

Ok.

>      # your method declarations here;  I would append 'Name' to
>      # the accessor / mutator, to clarify that what will be returned
>      # is the name of the folder, not the folder object itself.

Well, my proposal for getMembersFolder() *is* to return the folder 
object itself. Do you propose not to do that?

Wouldn't it be better to use 'Id' instead of 'Name'?
   setMembersFolderId() or
   setMembersFolderById()


Cheers,

Yuppie