I should be able to create a generic Choice Property
Summary: This is a major rethink of the notion of Choices, to be more general and powerful.
The core notion is that a Property P of type T can have two meta-Properties:
- Choose From Property -- this specifies another Property P2, which should specifically be a List of T. (More precisely, a List that can be coerced to T.)
- Choose From Thing -- (optional) this specifies the Thing S that the Property is found on.
Values of P are conceptually constrained to values of S.P2
. When we display the Editor for P, we display it as a drop-down of the values of S.P2
, in order, and the user can choose one of them. Conceptually, if P is a Set, it should display a multi-Select, and you can choose any number of the values, but we may not implement that at first.
Choose From Thing
is optional in order to enable dependent choices, but in the simple case it should be there.
Eventually, all of this should have a nice creation UI. But initially, for Arisia, we can live with something grody and hand-built.
In the simple and common case, the choices will be stored as meta-data on Property P itself. So Choose From Thing
will be P, and Choose From Property
will be a hidden meta-Property on it, which you will normally edit via the nice creation UI.
Note that, unlike previous formulations, Choices here do not have to be Links, or even Tags -- they can be any type.
In principle, if P is Link or Tag, then P and P2 should have the same Choice Model. This should eventually be enforced.