On 1/22/06, Michele Cella <[EMAIL PROTECTED]> wrote:
> > class ContactFields(WidgetsDeclaration):
> > age = TextField(name="age")
> > name = TextField(name="name")
> >
> > even though it violates DRY, or
>
> Yes, I've also thought about this and I must agree that even if it
> violates DRY it will hide any remaining magic, explicit is better than
> implicit and I like this even if it needs some more typing.
I don't think that form has much reason to exist... I don't find it
tremendously better than this:
widgets=[
TextField(name="age")
TextField(name="name")
]
Your original WidgetsDeclaration form looked good to me and is
minimally magical. (In fact, I'd really say that the main bit of magic
going on there is the hack to keep the ordering straight. The rest is
just a simple use of a metaclass.)
Kevin