wlanslovenija / django-tastypie-mongoengine

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

Add support for filtering on EmbeddedDocumentField #23

Closed gump closed 11 years ago

gump commented 12 years ago

Currently it's not possible to filter by values stored in EmbeddedDocumentField.

When attempting to search by any of the embedded document fields - the error is thrown in "tastypie/resources.py", line 1584, in check_filtering function: raise InvalidFilterError("The '%s' field does not support relations." % field_name)

It is possible to force django-tastypie-mongoengine to allow search by that field (by wrapping the field resource in a class that overrides the is_related value), however it does mean breaking the create/edit actions via the API.

mitar commented 11 years ago

Would you like to provide a pull request for this? Or at least a pull request with failing test?

mitar commented 11 years ago

Is this a duplicate of #9?

gump commented 11 years ago

Looks like a duplicate indeed. Sorry didn't mean to duplicate ;)

mitar commented 11 years ago

But you are talking about embedded document field, while #9 talks about lists of them?

gump commented 11 years ago

Hmm. You're right. Didn't read carefully enough. Forgot to add, that unfortunately I don't have a pull request for you with a fix for this. I'm slowly switching from mongo to Postgres with hstore, so this is no longer needed for my project.

mitar commented 11 years ago

OK. So this is duplicate of #9.