potatolondon/potatopage — pull request #1 by armirusco (2013-06-18 10:10:37+00:00)
Title: Introducing object managers.

The current problem we had was that the `UnifiedPaginator` only works with Django-nonrel querysets that are based on the normal AppEngine datastore. Therefore I started to split off the logic for querying objects and all query-related stuff and put it in a subclass of `object_managers.base.ObjectManager`. That means:

* `UnifiedPaginator` takes an object manager as argument
* It uses the object manager to retrieve all necessary objects and takes care of cursor caching, etc.
* `ObjectManager` subclasses only take care of generating a cache key for the given queryset and do then the actual querying, cursor getting/setting, etc.
* Created one `ObjectManager` subclass for normal Django Nonrel queries and one for App Engine's NDB queries. The latter one could do with some more tests though.
* There are now two subclasses of the `UnifiedPaginator`, one for each object manager. It makes it a bit easier to use a paginator as you don't have to worry about the object manager, only passing in the right query to the right paginator.

Now that we separated this, we could definitely do with some more tests!