KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a tastypie resource for a model. I also have a view which comes up with a queryset which needs to be serialised and sent to client. I am looking for a way to let tastypie resource handle the serialisation and dehydration of the queryset. I see that I can pass a single object to [Resource.build_bundle(self, obj=None, data=None, request=None)][1] to create a bundle and then pass the bundle to [Resource.full_dehydrate(self, bundle)][2] and finally call [Resource.serialize(self, request, data, format, options=None)][3] on the dehydrated data. But I want to convert full queryset to json and not just a single object. Maybe all I need is a way to convert full queryset to bundle. Any help is appreciated!
Tags (comma-separated)
Save Edits
Cancel