John McKeon wrote:
I too wrestled with ways to filter descriptions and while writing
PRStructure and PRCase subclasses ran across the isSetting property
and realized it was the manna of description filters. So I'm using
several of my own extension of MADescription to use like anObject
description select: [ :desc | desc isStatus or isQueued etc. It is a
An example of what I have been doing.
I have a UserLogin model, with fields 'username', 'email' and
'password'. I offer several descriptions for different purposes. e.g.
when registering a new user, I make the username readwrite.
I make the password field hidden.
Now UserLogin is part of a bigger model, UserModel, which has two parts,
#login, and #personal, plus the parts of its subclasses, e.g. #billing
#shipping (optional) #salesTax etc.
When completing the registration of the new user the UserModel is filled
out, but since we have already got the UserLoginData, the
has #descriptionLogin set to hidden.
and so on...
I agree the beSettings approach is very useful. But I cant see it being
very helpful for these enable/disable type operations I am doing here.
Its not that I want to filter out descriptions, I am just tweaking one
ot two parameters on a description, but first I have to find that field
description using atLabel: (soon to be atName:)