toastdriven/django-tastypie — pull request #1242 by pztrick (2014-10-27 00:34:08+00:00)
Title: Resource.save_m2m travels double-underscore relations

## Problem
```
# resources.py
class QuestionResponseResource(ResourceMixin):
choices = fields.ToManyField('api.v1.resources.QuestionChoiceResource', 'question__choices', null=True, full=True)
# ... snip ...
```

**Problem**: `PUT`ing to a resource with a double-underscore m2m relation raises this exception:

```
[26/Oct/2014 23:10:18] "PUT /api/v1/question_response/75/ HTTP/1.1" 200 1162
Traceback (most recent call last):
File "/home/patrick/code/gridpar/api/v1/resources/questions.py", line 34, in save_m2m
bundle = super(QuestionResponseResource, self).save_m2m(bundle)
File "/home/patrick/.virtualenvs/gridpatrick/lib/python2.7/site-packages/tastypie/resources.py", line 2346, in save_m2m
related_mngr = getattr(bundle.obj, field_object.attribute)
AttributeError: 'QuestionResponse' object has no attribute 'question__choices'
```

## Solution

This patch properly recurses through double-underscore properties to `getattr` the correct m2m related object manager (instead of trying to `getattr(bundle.obj, 'questions__choices')` which does not work).