[Zope-CMF] Small change on MemberdataTool

Sidnei da Silva sidnei@x3ng.com
Mon, 19 May 2003 15:17:42 -0300


On Mon, May 19, 2003 at 09:46:31AM -0400, Tres Seaver wrote:
| On Sun, 2003-05-18 at 08:56, Sidnei da Silva wrote:
|
| > I would like to make a small change on MemberdataTool, so it does get
| > the wrapper class from a property on the tool, instead of hardcoding
| > it. Otherwise, you have to override a full method when subclassing to
| > make something useful out of it.
| >
| > The change would not affect behavior, and I think its a nice
| > improvement (and I need it for NZO :P), so if its ok, I would make the
| > change on 1_3-branch, 1_4-branch and HEAD.
|
| Does NZO require that this be on the 1.3 branch?  This is really a new
| feature;  I can see sneaking it into 1.4 (it should be low risk), but I
| have no plans at the moment to release a 1.3.2, and would really like to
| keep the change set on that branch to essential bugfixes (so that making
| a 1.3.2 release requires the least amount of testing).

Well, as 1.4 isnt final yet, I think were going to stick with 1.3 for
NZO, as its stable and well tested. About the change being required,
well... its not exactly required, but having to duplicate a 20+ line
long method just for a 1-line change, and having to watch for changes
on the original product seems completely awkward to me.

| > Im proposing to change MemberDataTool.wrapUser(), around line 164 (on
| > my 1_3-branch checkout) to get the class from a property of the
| > MemberDataTool class.
| >
| > -                m = MemberData(base, id)
| > +                m = self._data_wrapper_class(base, id)
|
| I'd rather that it call a method to get the wrapper class:
|
|   def _getDataWrapperClass( self ):
|       return self._data_wrapper_class
|
| That way, somebody could write a more clever tool (e.g., one which had
| the "dotted name" of the class as a string property), without requiring
| that they keep a special attribute in sync.

Even better! Thats exactly what I had in mind (but of course for
including in HEAD, not in 1.3-branch).

[]'s
--
Sidnei da Silva (dreamcatcher) <sidnei@x3ng.com.br>
X3ng Web Technology <http://www.x3ng.com.br>
GNU/Linux user 257852
Debian GNU/Linux 3.0 (Sid) 2.4.18 ppc

Profanity is the one language all programmers know best.