Re: [Modeling-users] Handling custom types for attributes
Status: Abandoned
Brought to you by:
sbigaret
From: Sebastien B. <sbi...@us...> - 2003-12-21 19:07:19
|
Hi, Mario Ruggier <ma...@ru...> writes: > Hello! >=20 > I would like to use custom FixedPoint values for an attribute of an obje= ct. > So, I do as the example in Chapter 9 of the userguide suggests... so I d= efine > the "private" methods obj._setX(val) and obj._getX(). However, when the > client code calls the corresponding public setX and getX methods, the > private ones are never called! Any ideas what I may be missing out on? > I am using 0.9-pre-16 of modeling plus bug862182.patch > (no other patches I think). Well, I think there should be something obscure in the doc. if it made you think that public methods call the corresponding private ones. It is definitely not the case (at least by default, nothing prevents you from doing this). Private accessors (as searched by KeyValueCoding.storedValueForKey) are the only one used by the framework. That's why they can be used, in particular, to define transformation from sql types to custom types. Without more info. I cannot really tell why this bothers you so much :) > Another small point: the example _get method in: > <http://modeling.sourceforge.net/UserGuide/attribute-custom-type- > example.html> > should surely read: >=20 > if not self._price: > return None >=20 > as opposed to (if self._price: ... ) Absolutely, thanks! -- S=E9bastien. |