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. It's implemented by formencode.declarative.Declarative, which is a superclass of Validator. You can use it in your own classes to avoid writing a boilerplate .__init__ method. Someday there will be a FormEncode manual that mentions it. Until then, I'd recommend reading the docstrings of all the FormEncode modules. Note that some of the validators seem (to me) old or useless, so if something looks strange, it probably is. -- 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.
