Permalink
Browse files

obj_create should return a bundle with created object

  • Loading branch information...
1 parent 7354b97 commit fecf3677d3f0aca4c5c954354d8d8a9c8db25abb Alper Kanat committed Dec 26, 2013
Showing with 3 additions and 2 deletions.
  1. +3 −2 tastypie_mongodb/resources.py
@@ -80,9 +80,10 @@ def obj_create(self, bundle, **kwargs):
self.authorized_create_detail(bundle.data, bundle)
- bundle.obj = self.get_collection().insert(bundle.data)
+ oid = self.get_collection().insert(bundle.data)
+ obj = self._meta.object_class.objects.get(_id=ObjectId(oid))
- return bundle
+ return self.build_bundle(request=bundle.request, data=bundle.data, obj=obj)
def obj_update(self, bundle, **kwargs):
"""

0 comments on commit fecf367

Please sign in to comment.