I've seen the "schema.One()" syntax around a few times since PyCon, and there's always been something that bothers me slightly about it. I think what it comes down to is that you're almost always defining "one" of something - and the rest of the time is divided between lists and dicts.

What about turning this syntax on its head and saying
class ....:
body = Types.Lob(displayName = "body", doc="whee", cardinality=schema.One)

(where of course, cardinality would default to One)

On a related note, having reasonable defaults for things is really important.. for instance, it would be really nice if the displayName actually defaulted to the name, in case you didn't define one.

It just seems like this simplifies simple single-cardinality instances to something really easy:

body = Types.Lob()

But otherwise... I love this proposal. I can't wait to use it...

Alec

_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Open Source Applications Foundation "Dev" mailing list
http://lists.osafoundation.org/mailman/listinfo/dev

Reply via email to