Re: Documentation for Int() wrong?
Ian Bicking <[email protected]>
| Newsgroups | gmane.comp.python.formencode |
|---|---|
| Message-ID | <[email protected]> |
Felix Schwarz wrote:
> Hi,
>
> http://formencode.org/class-formencode.validators.Int.html states:
>> Messages
>>
>> badType:
>> The input must be a string (not a %(type)s: %(value)r)
>> empty:
>> Please enter a value
>> integer:
>> Please enter an integer value
>> noneType:
>> The input must be a string (not None)
>>
>
> Looking at the source code, I see only one message:
>> messages = {
>> 'integer': _("Please enter an integer value"),
>> }
>
> Does the Int validator raise the documented messages somewhere?
The other messages are inherited; FormEncode merges subclass messages
during instantiation (in the metaclass).
FancyValidator in particular is what adds all these other messages, some
called by default (e.g., empty), others only if you call a helper method
(e.g., assert_string).
--
Ian Bicking : [email protected] : http://blog.ianbicking.org
: Write code, do good : http://topp.openplans.org/careers
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems? Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/