This tweaks the es_required_or_50x decorator to handle other ElasticSearch errors and also improves the documentation. It also allows for template overrides and nixes the msg arguments--they seemed less flexible. Note: These decorators have no tests in the test suite, yet.
tl;dr: This is a big rewrite with huge API-breaking changes. This replaces the old model-type system with the new MappingType system. This adds a degree of separation between models (traditionally stored in a db) and documents (stored in ElasticSearch). Untyped S works just like in v0.4 with the exception that if you don't specify values_dict or values_list, you now get back a list of DefaultMappingType which are slightly more useful than dicts. You can now create an S typed by a MappingType which makes it easier to specify the index and doctype, but also allows you to tie business logic to search results and also tie that back to db objects in a lazy-loading way. For example, say you had a description field and wanted to have a truncated version of it:: class MyMappingType(MappingType): def description_truncated(self): return self.description[:100] res = list(S(MyMappingType).query(description__text='stormy night')) print res.description_truncated() Also, inextricably linked with this commit is a minor rewrite of the test suite. They should run faster now, are better organized, and should be easier to write in the future. test_django.py doesn't look like it was written by a shrewdness of apes any more. Also fixed a bug where `fields` was affected by ``values_list`` and ``values_dict`` calls---the two need to be separated.