[prev in list] [next in list] [prev in thread] [next in thread] 

List:       zope-dev
Subject:    Re: [Zope-dev] getUserById
From:       Florent Guillaume <fg () nuxeo ! com>
Date:       2004-12-14 18:27:48
Message-ID: 41BF30A4.60409 () nuxeo ! com
[Download RAW message or body]

Chris McDonough wrote:
> On Tue, 2004-12-14 at 12:37 +0100, Florent Guillaume wrote:
> 
>>def getUserById(self, id, default=None):
>>    user = self.getUser(id)
>>    if user is not None:
>>        return user
>>    return default
> 
> 
>>or even:
>>
>>def getUserById(self, id, default=None):
>>    return self.getUser(id) or default
> 
> 
> FWIW, I assume it's understood that neither of these will do the right
> thing for anything except the default Zope user folder (aka
> "UserFolder"), so it's arguable that these implementations probably
> shouldn't go into the BasicUserFolder base class (which is a base class
> for "UserFolder" and maybe a lot of other user folders).  That said, I
> think every other user folder implementation on the planet overrides
> these methods.

Well if for them id != name, they have to override them.

> FWIW, the user folder API is a complete mess (there
> really is no sane API).  It might be best to just step away slowly from
> this unless you want to own it. ;-)

No argument there :)

Stefan wanted some cleanup, why not. Defining the precise semantics is 
the first step anyway.

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   fg@nuxeo.com
_______________________________________________
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic