opinkerfi/adagios — pull request #393 by palli (2014-07-06 16:38:39+00:00)
Title: Replace PynagChoiceField with PynagAutoCompleteField

This is a big rework of how PynagForm (a.k.a. "Edit Object") form handles saving data.

We now finally have a unit testing framework around PynagForm, which exposed multiple bugs. Please help test this new form, take special care testing the following:
* Saving one field when other fields contain invalid data
* Changing one field and make sure no other fields are changed
* Make sure MultiChoice autocompletion auto completes the correct types (i.e. not autocomplete hosts if the field is called contactgroups)

The old field had multiple bugs and problems which this class tries to circumvent. This includes:
* Old field type was using
* No way to differentiate between hostgroup field missing, and all hostgroups removed
* No ability to include hosts/hostgroups that did not already exist (wildcard problem)
* Trouble with reliably saving data

This patch includes:
* Added new type of field called PynagAutoCompleteField.
* Move (most) PynagChoiceFields to use PynagAutoCompleteField
* Multiple bugfixes for objectbrowser PynagForm
* Added multiple unittests for PynagForm PynagChoiceField and PynagAutoCompleteField