toastdriven/django-tastypie — Issue #306: always_return_data not working
Author: semente
Created: 2011-11-30 11:48:20+00:00
State: open

I tried set always_return_data to True but my API never returns data in POST or PUT requests. I've asked for help in Google Groups but no one answered, so might be a bug.

Look my Resource and request:

```python
class CheckInResource(ModelResource):
venue = fields.ToOneField(...)
class Meta:
resource_name = 'venues/checkin'
queryset = CheckIn.objects.all()
fields = ('id', 'venue', 'checkin_time', 'checkout_time')
allowed_methods = ('get', 'post')
always_return_data = True
authentication = BasicAuthentication()
authorization = DjangoAuthorization()
filtering = {'venue': ('exact',)}

def obj_create(self, bundle, request=None, **kwargs):
return super(CheckInResource, self).obj_create(
bundle, request, customer=request.user
)

def apply_authorization_limits(self, request, object_list):
return object_list.filter(customer=request.user)
```

Request:

```python
>>> r = requests.post('http://127.0.0.1:8000/api/v1/venues/checkin/', data=json.dumps(payload), headers=headers, auth=auth)
>>> r.content
u''
```