Archive for July, 2013

Django on GAE using Python NDB

July 19, 2013

Recently in a comment on a post on dba.stackexchange I learned about a service called NDB, which presumably allows one to efficiently model many-to-many entity relationships in the google datastore.  And apparently it is pluggable with django, too, via this:

To use NDB with the Django web framework, add 'google.appengine.ext.ndb.django_middleware.NdbDjangoMiddleware', to the MIDDLEWARE_CLASSES entry in your Django file.

In terms of getting started with this particular kit, there is a tutorial here which I may investigate at some point.

As an additional remark, there is a comment on this post on stack overflow indicating that I’ve been a bit remiss all along, that intermediate tables are the way to store keys / manage joins if using django nonrel.  Nonetheless I think I’ll look into NDB for my future investigations, as either solution (NDB or django nonrel) requires reworking of models used in a django project, and I’d rather use one that offers automatic caching and batching, which apparently are useful things to have.