toastdriven/django-tastypie — pull request #984 by professorplumb (2013-07-13 02:54:18+00:00)
Title: [DOCS] Update Nested Resources example in cookbook.rst to work properly

The example on Nested Resources in cookbook.rst seems to be from an old version of tastypie, as ``cached_object_get`` expects a ``Bundle`` as its first argument, not a request. The current code will fail with ``AttributeError: 'WSGIRequest' object has no attribute 'request'``.

This patch shows how to build a stub bundle to make the example work correctly. I am not sure if this is the canonical way to build a bundle from a request - in particular, I don't pass in an ``obj``, but then the point of building the bundle is to get the object from ``cached_obj_get`` in the first place. :)