mitar/django-tastypie-mongoengine — pull request #19 by aparajita (2012-06-16 17:01:09+00:00)
Title: Fixes and enhancements to subresource handling

- Provided a way to configure a field to use as the pk for subresources using the subresource_pk field in Meta, so that individual embedded documents can reliably be addressed in a persistent way.

- If synthesized subresource pk's are being used, they start from 1, not zero. Zero is an invalid ObjectId, and when trying to create subresources, validate() is done on the parent, which validates embedded documents as well. If it sees a synthesized id of zero, it fails.

- Added support for sparse representation of ReferenceFields in an EmbeddedListField. If the 'full' field attribute is EmbeddedListField.SPARSE ('sparse'), then instead of returning an array of resource_uri, it returns an array of objects with the item "resource_uri" that contains the resource_uri. This allows clients to deal with embedded lists in a uniform way, as an array of objects.

- Small typo fixes

Signed off by: Aparajita Fishman