Usage of if_empty

michelts <[email protected]>
Newsgroups gmane.comp.python.formencode
Message-ID <[email protected]>
Good morning guys!

I used to have validators as the above:

class validator(Schema):
    firstName = NotEmpty()
    lastName = NotEmpty(if_empty='anything')

I updated FormEncode to the version 0.5.1 and now this is not working,
I look at the code and I see if_empty is no more supported, but the
docs on the formencode.org still have reference to if_empty.

I solve my problem for know changing my validator to the above:

class validator(Schema):
    firstName = NotEmpty()
    lastName = String()

But this way I can't set a specific lastName if it is not specified,
this is usefull in some situations. The if_empty keyword wont be
supported or this is a bug?

Thanks for all help!

-- 
Michel Thadeu Sabchuk
Curitiba - Brasil
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.