wlanslovenija / django-tastypie-mongoengine

MongoEngine support for django-tastypie.
Other
73 stars 59 forks source link

Failing with embedded documents' embedded lists #16

Closed leo-naeka closed 12 years ago

leo-naeka commented 12 years ago

Hi,

This is a case where embedded lists are not dehydrated when they are within an embedded document since it does not have a pk.

Fix works well and all test cases are completed but it may be a little dirty since I don't figure out why pk is required in the dehydrate process... Note that reverse_uri remains empty since embedded nested resources can not be acceded through the API.

Signed-off-by: Léo S. leo@naeka.fr

mitar commented 12 years ago

Thanks. It seems OK. This is because I was using code from ToManyField's dehydrate method.

mitar commented 12 years ago

Made correct fix for the bug: e6e982bf48cc228aeb74efbc7190f67887660342

mitar commented 12 years ago

The point is that get_resource_uri should not even be called and empty resource URI should not even be generated in the first place.