diff --git a/testapp/testapp/testmain/fields.py b/testapp/testapp/testmain/fields.py index a7143f6..0e8e5aa 100644 --- a/testapp/testapp/testmain/fields.py +++ b/testapp/testapp/testmain/fields.py @@ -12,11 +12,21 @@ class GetSearchTestField(AutoSelect2MultipleField): return True def get_results(self, request, term, page, context): """ - Just a trivial example. + Just a trivial example, with fixed values. """ res = [('Green Gold','Green Gold'),('Hulk','Hulk'),] return (NO_ERR_RESP, False, res) + def get_val_txt(self, value): + """ + The problem of issue #66 was here. I was not overriding this. + When using AutoSelect2MultipleField you should implement get_val_txt in this case. + I think that this is because there should be an unique correspondence between + the referenced value and the shown value + In this particular example, the referenced value and the shown value are the same + """ + return unicode(value) + class GetModelSearchTestField(AutoModelSelect2MultipleField): """ Selects a department.