On Tue, Mar 2, 2010 at 7:02 PM, Mike Orr <[email protected]> wrote: > I don't understand Johnathan's point. Most fields are strings, yes. > But I assumed Mark wanted integers. That's what SelectInt is for. > Otherwise you can just use OneOf. > > On Tue, Mar 2, 2010 at 5:28 PM, Mark <[email protected]> wrote: >> Thank you for the detailed explanation. >> >> One thing: What does __unpackargs__ do? I don't see this being used >> everytime, is it something optional? What do you usually supply it >> with? > > ``.__unpackargs__`` tells how many positional args the validator > constructor takes, and which attributes they should be assigned to. > FancyValidator takes no args, but custom subclasses might want to, to > specify constraints like length, minimum value, type, etc.
More specifically. FancyValidator takes no *positional* args. It takes keyword args which override its class attributes. That's another feature of Declarative: keyword args set same-name attributes. -- Mike Orr <[email protected]> -- You received this message because you are subscribed to the Google Groups "pylons-discuss" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/pylons-discuss?hl=en.
