In case anybody needs the same thing, this is how I was able to get it working... Thanks to GregM.
I created a class that inherits from tastypie ModelResource and made the adjustments to it. Then, all my resources use my class instead.
From his code, I just had to add a couple of try, except because when you GET a single item E.g. .../api/v1/user/2/ the meta doesn't exist and there is an AttributeError exception being thrown.
Then, you should be good to go.
class MyModelResource(ModelResource):
def create_response(self, request, data, response_class=HttpResponse, **response_kwargs):
try:
stripped_data = data.get('objects')
except AttributeError:
stripped_data = data
desired_format = self.determine_format(request)
serialized = self.serialize(request, stripped_data, desired_format)
response = response_class(content=serialized,
content_type=build_content_type(desired_format),
**response_kwargs)
# Convert meta data to HTTP Headers
try:
for name, value in data.get('meta', {}).items():
response['Meta-' + name.title().replace('_','-')] = str(value)
except AttributeError:
response['Meta-Empty'] = True
return response
Again, full credit to Greg, thanks.