Package spammcan :: Package forms :: Module validators :: Class SpamBayesFilter
[hide private]

Class SpamBayesFilter

source code

                        object --+            
                                 |            
formencode.declarative.Declarative --+        
                                     |        
              formencode.api.Validator --+    
                                         |    
             formencode.api.FancyValidator --+
                                             |
                                            SpamBayesFilter

Check given value dict against SpamBayes xmlrpc server.

**Messages**

``badType``:
  The input must be a string (not a ``%(type)s``: ``%(value)r``)

``empty``:
  Please enter a value

``isSpam``:
  Your form submission was rejected as spam.

``noneType``:
  The input must be a string (not None)

Nested Classes [hide private]

Inherited from formencode.api.FancyValidator: if_empty, if_invalid, if_invalid_python

Inherited from formencode.api.Validator: if_missing

Inherited from formencode.declarative.Declarative: __metaclass__

Instance Methods [hide private]
 
validate_python(self, value, state)
A validation method that doesn't do anything.
source code
 
convert_values(self, values, state=None) source code

Inherited from formencode.api.FancyValidator: assert_string, base64encode, empty_value, from_python, is_empty, to_python, validate_other

Inherited from formencode.api.FancyValidator (private): _validate_noop

Inherited from formencode.api.Validator: __init__, all_messages, message, subvalidators

Inherited from formencode.declarative.Declarative: __call__, __initargs__, __repr__, __sourcerepr__

Inherited from formencode.declarative.Declarative (private): _source_repr_class

Inherited from object: __delattr__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __setattr__, __str__

Class Methods [hide private]

Inherited from formencode.api.Validator (private): _initialize_docstring

Inherited from formencode.declarative.Declarative: __classsourcerepr__, singleton

Static Methods [hide private]

Inherited from formencode.api.Validator: __classinit__

Inherited from formencode.declarative.Declarative (private): _repr_vars

Class Variables [hide private]
  __unpackargs__ = ['error_field']
  sbrpc_url = 'http://localhost:8001/sbrpc'
  spam_threshold = 0.8
  default_score = 0.5
  messages = {'isSpam': u'Your form submission was rejected as s...
  _messages = {'badType': 'The input must be a string (not a %(t...
  declarative_count = 118

Inherited from formencode.api.FancyValidator: accept_python, not_empty, strip

Inherited from formencode.api.FancyValidator (private): _from_python, _to_python

Inherited from formencode.api.Validator: __singletonmethods__, compound, gettextargs, repeating, use_builtins_gettext

Inherited from formencode.declarative.Declarative: __mutableattributes__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

validate_python(self, value, state)

source code 

A validation method that doesn't do anything.

Overrides: formencode.api.FancyValidator._validate_noop
(inherited documentation)

Class Variable Details [hide private]

messages

Value:
{'isSpam': u'Your form submission was rejected as spam.'}

_messages

Value:
{'badType': 'The input must be a string (not a %(type)s: %(value)r)',
 'empty': 'Please enter a value',
 'isSpam': u'Your form submission was rejected as spam.',
 'noneType': 'The input must be a string (not None)'}