lukebpotato/djangae — pull request #54 by lukebpotato (2014-09-15 10:04:58+00:00)
Title: Implement context caching

This branch implements a request-specific context cache for unique field and primary key lookups. It's a bit naive at the moment, and the cache is wiped at the beginning and the end of transactions.

@adamalton , could you give this a good review? Behaviour should follow that described by https://developers.google.com/appengine/docs/python/ndb/cache but extended to unique constraints.

In future the cache could be made a stack, and entering a transaction would push the stack, and leaving would pop it, or apply it to the lower stack entry. But wiping should be enough for now, just not as efficient as it could be.