<commit_before># Django multi field form validation

<https://github.com/aumo/django_multifield_clean>

Provides a Django form mixin that allows declaring validation methods 
(similar to the Django `Form.clean_<field_name>()` methods) working on multiple 
fields, allowing less boilerplate code in `Form.clean()`.


*Tested on Django 1.7, 1.8 and Python 2.7, 3.2, 3.3, 3.4*


## Installation

`pip install django_multifield_clean`

## Usage

Make your form inherit from the `multifieldclean.forms.MultiFieldCleanFormMixin` mixin. Note that the mixin must come **before** the Django form class.


Declare methods starting with `MULTIFIELD_CLEAN_METHOD_PREFIX` (default is `multi_clean`) which arguments are named after field names.

Those methods will be called during the form validation process, after `Form.clean()`, with the field values their arguments are named after as parameters.
<commit_msg>Added Travis and Coveralls badges to README<commit_after># Django multi field form validation

<https://github.com/aumo/django_multifield_clean>

[![Build Status](https://travis-ci.org/aumo/django_multifield_clean.svg?branch=master)](https://travis-ci.org/aumo/django_multifield_clean)
[![Coverage Status](https://coveralls.io/repos/aumo/django_multifield_clean/badge.svg?branch=master)](https://coveralls.io/r/aumo/django_multifield_clean?branch=master)


Provides a Django form mixin that allows declaring validation methods 
(similar to the Django `Form.clean_<field_name>()` methods) working on multiple 
fields, allowing less boilerplate code in `Form.clean()`.


*Tested on Django 1.7, 1.8 and Python 2.7, 3.2, 3.3, 3.4*


## Installation

`pip install django_multifield_clean`

## Usage

Make your form inherit from the `multifieldclean.forms.MultiFieldCleanFormMixin` mixin. Note that the mixin must come **before** the Django form class.


Declare methods starting with `MULTIFIELD_CLEAN_METHOD_PREFIX` (default is `multi_clean`) which arguments are named after field names.

Those methods will be called during the form validation process, after `Form.clean()`, with the field values their arguments are named after as parameters.

{'fraction_non_alphanumeric': 0.09201307800093414, 'fraction_numerical': 0.011209715086408221, 'mean_word_length': 5.570552147239264, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 6, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '843856', 'n_tokens_mistral': 677, 'n_tokens_neox': 632, 'n_words': 222}