benoitc/couchdbkit — pull request #171 by dannyroberts (2013-09-13 20:26:20+00:00)
Title: bring back lenient wrapping unless classes is explicitly set

This commit keeps coming up and seems to have had unintended consequences other than merely being a refactor as the commit message says: https://github.com/benoitc/couchdbkit/commit/b88a6c4da90667cc5f0d8c7df9bcdc826b66dabd.

In particular, it changed the behavior so that `Foo.view(...)` always checks the doc type before wrapping, as if we'd called `Foo.view(..., classes={'Foo': Foo})`. In many cases, that's not desired. For example, in our code we have a lot of Document class hierarchies, and sometimes for simplicity we want to wrap all docs with the parent type; alternatively, we might want to wrap a doc that has the parent type with a subclass that gives it extra functionality. Those are just examples, but there are plenty of cases where you might want to do this.

This commit brings back the earlier behavior. If you want to have an explicit check, you can always pass in `classes`.

Does this change seem acceptable to you?